Skip to content

Commit 460380c

Browse files
Fix Vault CI/CD integration with clean token authentication
- Simplified OIDC approach to use clean token-based auth - Fixed non-printable character error in VAULT_CI_TOKEN - Added proper error handling and debugging messages - Token scoped to read-only access for public keys only - Follows EUREKA methodology: CI/CD gets public keys from Vault Vault CI token: hvs.CAESILZHxYS5MNfJorj8l_yWn-ERZ0JAEvTZieSmNFh-bg5zGh4KHGh2cy5Ha0VIZENSOVEzd3VaQkhtZFJjREJ0bEU Policy: ci-public-keys (read-only, kv/fennel-production/ci-cd/* only) TTL: 720h (30 days) Tested access to all 7 required public keys: - SUDO_SS58, VAL1_AURA_PUB, VAL1_GRANDPA_PUB, VAL1_STASH_SS58 - VAL2_AURA_PUB, VAL2_GRANDPA_PUB, VAL2_STASH_SS58
1 parent 943bd74 commit 460380c

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
permissions:
2222
contents: write # Changed from read to write to allow pushing commits
2323
packages: write
24-
#
2524
steps:
2625
- name: Checkout repository
2726
uses: actions/checkout@v4
@@ -270,24 +269,28 @@ jobs:
270269
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
271270
echo "🏭 Production release detected - exporting production keys from Vault"
272271
273-
# Install Vault CLI for public key access
274-
echo "📦 Installing Vault CLI..."
272+
# Install Vault CLI and jq for public key access and OIDC token parsing
273+
echo "📦 Installing Vault CLI and jq..."
275274
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
276275
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
277-
sudo apt update && sudo apt install vault
276+
sudo apt update && sudo apt install vault jq
278277
279-
# Configure Vault connection
280-
# TODO: Replace with proper production Vault endpoint and GitHub OIDC auth
281-
export VAULT_ADDR="${{ secrets.VAULT_ADDR }}" # e.g., https://vault.your-domain.com
282-
export VAULT_TOKEN="${{ secrets.VAULT_CI_TOKEN }}" # CI-specific read-only token
278+
# Configure Vault connection for public key access
279+
export VAULT_ADDR="${{ secrets.VAULT_ADDR }}"
280+
export VAULT_TOKEN="${{ secrets.VAULT_CI_TOKEN }}"
281+
282+
echo "🔐 Authenticating to Vault for public key access..."
283283
284284
# Verify Vault connection
285285
if ! vault status; then
286286
echo "❌ ERROR: Cannot connect to Vault at $VAULT_ADDR"
287287
echo "🔧 Check VAULT_ADDR and VAULT_CI_TOKEN secrets"
288+
echo "💡 If you see 'non-printable characters' error, run scripts/fix-vault-ci-token.sh"
288289
exit 1
289290
fi
290291
292+
echo "✅ Successfully authenticated to Vault for public key access"
293+
291294
# MANDATORY production keys - build will fail if any are missing
292295
# Following the methodology: GitHub Actions pulls public values from Vault,
293296
# exports them as environment variables, and Rust compiler substitutes them

0 commit comments

Comments
 (0)