Release: harden multiline secret handling
Modular container CI / release-build (push) Has been cancelled

This commit is contained in:
faumaray committed 2026-07-30 03:58:21 +03:00
1 parent ebb751f22c
commit 697db046d3
9 files changed
+133 -56

No files matched your search

+23 -12
View File
@@ -37,12 +37,12 @@ through that container's Docker mount table. The release wrapper and
control-plane tests both use it because bind mount paths passed to the socket
are resolved by the runner host daemon, not inside the Actions job container.
The SSH checkout steps and `scripts/lib/component-ssh.sh` pin the current
The shared `scripts/lib/component-ssh.sh` helper pins the current
`git.faumaray.ru` RSA host key. Its verified fingerprint is
`SHA256:fugBYnqAnqmTLsGpafVgQF9gPQzJqps7uHvs48blg2A`. If the Gitea SSH host key
is intentionally rotated, verify the new fingerprint through an independent
administrator channel and update `ssh-known-hosts` in all three workflows plus
the shared helper. Component Git commands use `BatchMode=yes` and strict host
administrator channel and update the shared helper. Component Git commands use
`BatchMode=yes` and strict host
checking, so missing credentials or a changed host key fail instead of waiting
for interactive runner input. Never work around a rotation by disabling strict
host-key checking.
@@ -57,16 +57,25 @@ workflow. A global runner such as the default installation shown in Gitea must
only serve repositories you trust: a workflow with Docker-daemon access can
control the runner host.
Enable Actions and add these repository secrets:
Enable Actions and configure these secrets:
| Secret | Purpose |
| --- | --- |
| `RELEASE_CHECKOUT_SSH_KEY` | Release-bot SSH key used to read every private component/dependency repository and to fast-forward the protected Echoion `release-feed` branch. |
| `RELEASE_BOT_TOKEN` | PAT owned by a dedicated bot. It needs repository write scope for component releases and package write scope for the public organization registry. It does not need `release-feed` write access. |
| `RELEASE_TAG_ALLOWED_SIGNERS` | Complete OpenSSH `allowed_signers` lines for maintainers allowed to publish `v*` tags. |
| `RELEASE_FEED_ED25519_PUBLIC_KEY` | PEM public key matching the component-feed signing key. It verifies independently published components without exposing signing authority to the product workflow. |
| Secret | Scope | Purpose |
| --- | --- | --- |
| `RELEASE_CHECKOUT_SSH_KEY` | `Void` organization | Single-line base64 of the release-bot OpenSSH private key used to read every private component/dependency repository and to fast-forward the protected Echoion `release-feed` branch. |
| `RELEASE_BOT_TOKEN` | `Void` organization | PAT owned by a dedicated bot. It needs repository write scope for component releases and package write scope for the public organization registry. It does not need `release-feed` write access. |
| `RELEASE_TAG_ALLOWED_SIGNERS` | `Void` organization | Complete OpenSSH `allowed_signers` lines for maintainers allowed to publish `v*` tags. |
| `RELEASE_FEED_ED25519_PRIVATE_KEY` | `Void` organization | Single-line base64 of the Ed25519 PEM private key that signs component feeds. |
| `RELEASE_FEED_GIT_SIGNING_KEY` | `Void` organization | Single-line base64 of the OpenSSH private key that signs `release-feed` commits. |
| `RELEASE_FEED_ED25519_PUBLIC_KEY` | Echoion repository | PEM public key matching the component-feed signing key. It verifies independently published components without exposing signing authority to the product workflow. |
Root product checkouts use pinned SSH with `persist-credentials: false`.
Encode multiline private keys with `base64 -w0` before storing them. This is a
security requirement: the release scripts reject raw multiline private keys so
runner environment diagnostics cannot disclose them. Keep the public
`RELEASE_TAG_ALLOWED_SIGNERS` and `RELEASE_FEED_ED25519_PUBLIC_KEY` values in
their documented text formats.
Root product checkouts use the public repository over HTTPS with
`persist-credentials: false`.
Independent workflows check out their current repository with Gitea's job
token and the public Echoion release tools over HTTPS; their private
component/dependency reads and `release-feed` push use the pinned SSH helper.
@@ -212,7 +221,9 @@ signing run as urgent.
## Feed key custody and rotation
The active component-feed public key id is
`echoion-component-release-2026-07-30`. The older
`echoion-component-release-2026-07-30-r2`. The superseded
`echoion-component-release-2026-07-30` key is intentionally absent because its
private material was revoked before any feed publication. The older
`echoion-component-release-2026-07` and `echoion-release-2026-07` keys remain
embedded for compatibility. To rotate,
generate the private key on a trusted operator machine:
@@ -8,7 +8,7 @@
"ed25519": "vUZXQXNkY/f/D42z6/dYK8SNxCvXjxYQ8ZCpjecIclk="
},
{
"id": "echoion-component-release-2026-07-30",
"ed25519": "ZPRktsjik0zKyxPj1/TZT0CdLU1TIgxVPehTyGDNz1E="
"id": "echoion-component-release-2026-07-30-r2",
"ed25519": "0ioZyP3v38st9qShLG9+gvdM8xd8AgO7UNaP5eeHflk="
}
]
+2 -5
View File
@@ -22,14 +22,10 @@ jobs:
docker version
docker info
- name: Check out root over SSH
- name: Check out public root
uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
fetch-depth: 0
ssh-key: ${{ secrets.RELEASE_CHECKOUT_SSH_KEY }}
ssh-user: gitea
ssh-known-hosts: >-
git.faumaray.ru ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCzZEz9JLrzk6oLiloSbueAN28vYL58Y/dTHBgRuBMMib9IJ1aDJShhr3kwC9sfOT0AzK0uwcMAqCAIkwJwttde8dIg0Mee0cmB/1JkoqFF4X3MUGD1r3nk8SSZNhIiPqo16hDF9Hf3FkovztIlBVntkyP9Iy9hYfP818Tiq3yRXROGdHjR7IfY4jR2QGfGrd/RtvPGExVqusxidy141240A8aRAwMFUqFdEvmXWjizrtCUqcrL/k1GEh0yJzbCdNOVUI6OuWd8tPluSBvmmeoNpKnCSl4Mkg36HObbOyrsme0asZqjcj0od65WYWApMPN0pUqhNu2CP83Nfor2VFwkdPRwe7cAZ0OD/8wyT6Hz5q1wWgf82y4tYDoDRYsd8JU86eebkJ07T5nCrEeC4Sj+qT4S5xv/kECAhxyP4QGnunORnY2fYsdNGzpPvbMN7gHe9UcIcQdOIgV3wrR1qpMVNcd8AEC2A3TRv/jzMCHSjmGGpgiy1Db2CZAjp5+PcjNmjvoPNN0NiA9X4rIVSeTfflWnDRmeNRJeZa73StjpU17EcAf97COUQPGWJQDgpJqINSpYU50fuaLBfzKnIRuiHjKQmyKe/zgRSmulnYFYM3AJfn8Ykg2VvkUQGvCt1+fqYiUa1iVFuwPP3ZigYF1mOZRpPnos5kaNmlB01q2sZw==
persist-credentials: false
- name: Verify source-free root and resolve every lock over SSH
@@ -69,6 +65,7 @@ jobs:
run: |
set -euo pipefail
bash scripts/tests/test-gitea-tag-verification.sh
bash scripts/tests/test-component-ssh-secrets.sh
. scripts/lib/docker-daemon-path.sh
docker_workspace=$(docker_daemon_path "$PWD")
for test_script in \
+1 -5
View File
@@ -25,15 +25,11 @@ jobs:
docker version
docker info
- name: Check out signed main over SSH
- name: Check out public signed main
uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
ref: main
fetch-depth: 0
ssh-key: ${{ secrets.RELEASE_CHECKOUT_SSH_KEY }}
ssh-user: gitea
ssh-known-hosts: >-
git.faumaray.ru ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCzZEz9JLrzk6oLiloSbueAN28vYL58Y/dTHBgRuBMMib9IJ1aDJShhr3kwC9sfOT0AzK0uwcMAqCAIkwJwttde8dIg0Mee0cmB/1JkoqFF4X3MUGD1r3nk8SSZNhIiPqo16hDF9Hf3FkovztIlBVntkyP9Iy9hYfP818Tiq3yRXROGdHjR7IfY4jR2QGfGrd/RtvPGExVqusxidy141240A8aRAwMFUqFdEvmXWjizrtCUqcrL/k1GEh0yJzbCdNOVUI6OuWd8tPluSBvmmeoNpKnCSl4Mkg36HObbOyrsme0asZqjcj0od65WYWApMPN0pUqhNu2CP83Nfor2VFwkdPRwe7cAZ0OD/8wyT6Hz5q1wWgf82y4tYDoDRYsd8JU86eebkJ07T5nCrEeC4Sj+qT4S5xv/kECAhxyP4QGnunORnY2fYsdNGzpPvbMN7gHe9UcIcQdOIgV3wrR1qpMVNcd8AEC2A3TRv/jzMCHSjmGGpgiy1Db2CZAjp5+PcjNmjvoPNN0NiA9X4rIVSeTfflWnDRmeNRJeZa73StjpU17EcAf97COUQPGWJQDgpJqINSpYU50fuaLBfzKnIRuiHjKQmyKe/zgRSmulnYFYM3AJfn8Ykg2VvkUQGvCt1+fqYiUa1iVFuwPP3ZigYF1mOZRpPnos5kaNmlB01q2sZw==
persist-credentials: false
- name: Verify root cutover and check out locked components over SSH
+22 -16
View File
@@ -25,15 +25,11 @@ jobs:
docker version
docker info
- name: Check out the signed root tag over SSH
- name: Check out the public signed root tag
uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
ref: ${{ gitea.ref }}
fetch-depth: 0
ssh-key: ${{ secrets.RELEASE_CHECKOUT_SSH_KEY }}
ssh-user: gitea
ssh-known-hosts: >-
git.faumaray.ru ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCzZEz9JLrzk6oLiloSbueAN28vYL58Y/dTHBgRuBMMib9IJ1aDJShhr3kwC9sfOT0AzK0uwcMAqCAIkwJwttde8dIg0Mee0cmB/1JkoqFF4X3MUGD1r3nk8SSZNhIiPqo16hDF9Hf3FkovztIlBVntkyP9Iy9hYfP818Tiq3yRXROGdHjR7IfY4jR2QGfGrd/RtvPGExVqusxidy141240A8aRAwMFUqFdEvmXWjizrtCUqcrL/k1GEh0yJzbCdNOVUI6OuWd8tPluSBvmmeoNpKnCSl4Mkg36HObbOyrsme0asZqjcj0od65WYWApMPN0pUqhNu2CP83Nfor2VFwkdPRwe7cAZ0OD/8wyT6Hz5q1wWgf82y4tYDoDRYsd8JU86eebkJ07T5nCrEeC4Sj+qT4S5xv/kECAhxyP4QGnunORnY2fYsdNGzpPvbMN7gHe9UcIcQdOIgV3wrR1qpMVNcd8AEC2A3TRv/jzMCHSjmGGpgiy1Db2CZAjp5+PcjNmjvoPNN0NiA9X4rIVSeTfflWnDRmeNRJeZa73StjpU17EcAf97COUQPGWJQDgpJqINSpYU50fuaLBfzKnIRuiHjKQmyKe/zgRSmulnYFYM3AJfn8Ykg2VvkUQGvCt1+fqYiUa1iVFuwPP3ZigYF1mOZRpPnos5kaNmlB01q2sZw==
persist-credentials: false
- name: Reject embedded component sources and gitlinks
@@ -84,10 +80,17 @@ jobs:
test "$EXPECTED_REF_TYPE" = tag
test "$EXPECTED_REF" = "refs/tags/$TAG"
allowed_signers="$RUNNER_TEMP/echoion-release-allowed-signers"
trap 'rm -f -- "$allowed_signers"' EXIT
tag_credentials="$RUNNER_TEMP/echoion-release-tag-ssh"
trap 'rm -rf -- "$tag_credentials"; rm -f -- "$allowed_signers"' EXIT
umask 077
printf '%s\n' "$TAG_ALLOWED_SIGNERS" >"$allowed_signers"
test -s "$allowed_signers"
. scripts/lib/component-ssh.sh
echoion_configure_component_ssh \
"$tag_credentials" "$ECHOION_COMPONENT_SSH_KEY"
scripts/restore-gitea-release-tag.sh \
--repository "ssh://gitea@git.faumaray.ru/$REPOSITORY.git" \
--tag "$TAG"
target_commit=$(
scripts/verify-gitea-release-tag.sh \
--tag "$TAG" \
@@ -147,16 +150,19 @@ jobs:
printf 'RELEASE_FEED_URL=%s\n' "$feed_url"
} >>"$GITHUB_ENV"
- name: Check out the protected release-feed branch over SSH
uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
ref: release-feed
path: feed-state
fetch-depth: 0
ssh-key: ${{ secrets.RELEASE_CHECKOUT_SSH_KEY }}
ssh-user: gitea
ssh-known-hosts: >-
git.faumaray.ru ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCzZEz9JLrzk6oLiloSbueAN28vYL58Y/dTHBgRuBMMib9IJ1aDJShhr3kwC9sfOT0AzK0uwcMAqCAIkwJwttde8dIg0Mee0cmB/1JkoqFF4X3MUGD1r3nk8SSZNhIiPqo16hDF9Hf3FkovztIlBVntkyP9Iy9hYfP818Tiq3yRXROGdHjR7IfY4jR2QGfGrd/RtvPGExVqusxidy141240A8aRAwMFUqFdEvmXWjizrtCUqcrL/k1GEh0yJzbCdNOVUI6OuWd8tPluSBvmmeoNpKnCSl4Mkg36HObbOyrsme0asZqjcj0od65WYWApMPN0pUqhNu2CP83Nfor2VFwkdPRwe7cAZ0OD/8wyT6Hz5q1wWgf82y4tYDoDRYsd8JU86eebkJ07T5nCrEeC4Sj+qT4S5xv/kECAhxyP4QGnunORnY2fYsdNGzpPvbMN7gHe9UcIcQdOIgV3wrR1qpMVNcd8AEC2A3TRv/jzMCHSjmGGpgiy1Db2CZAjp5+PcjNmjvoPNN0NiA9X4rIVSeTfflWnDRmeNRJeZa73StjpU17EcAf97COUQPGWJQDgpJqINSpYU50fuaLBfzKnIRuiHjKQmyKe/zgRSmulnYFYM3AJfn8Ykg2VvkUQGvCt1+fqYiUa1iVFuwPP3ZigYF1mOZRpPnos5kaNmlB01q2sZw==
- name: Check out the protected release-feed branch
shell: bash
env:
ECHOION_COMPONENT_SSH_KEY: ${{ secrets.RELEASE_CHECKOUT_SSH_KEY }}
run: |
set -euo pipefail
feed_credentials="$RUNNER_TEMP/echoion-release-feed-ssh"
trap 'rm -rf -- "$feed_credentials"' EXIT
. scripts/lib/component-ssh.sh
echoion_configure_component_ssh \
"$feed_credentials" "$ECHOION_COMPONENT_SSH_KEY"
git clone --filter=blob:none --branch release-feed --single-branch \
ssh://gitea@git.faumaray.ru/Void/Echoion.git feed-state
- name: Verify every locked component was independently published
shell: bash