Compare commits
4 Commits
devin/1776
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b5cebf505 | ||
| fe9edd842b | |||
| fdb14dc420 | |||
| 7c018965eb |
43
.gitea/workflows/deploy-live.yml
Normal file
43
.gitea/workflows/deploy-live.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Deploy Explorer Live
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main, master]
|
||||
paths:
|
||||
- '.gitea/workflows/deploy-live.yml'
|
||||
- 'backend/**'
|
||||
- 'config/**'
|
||||
- 'deployment/**'
|
||||
- 'docs/**'
|
||||
- 'frontend/**'
|
||||
- 'scripts/**'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- 'Makefile'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Validate live deploy assets
|
||||
run: |
|
||||
test -f scripts/deploy-explorer-config-to-vmid5000.sh
|
||||
test -f scripts/deploy-explorer-ai-to-vmid5000.sh
|
||||
test -f scripts/deploy-next-frontend-to-vmid5000.sh
|
||||
test -f deployment/LIVE_DEPLOYMENT_MAP.md
|
||||
|
||||
- name: Trigger explorer-live deployment
|
||||
run: |
|
||||
SHA="$(git rev-parse HEAD)"
|
||||
BRANCH="${GITHUB_REF_NAME:-}"
|
||||
if [ -z "$BRANCH" ] || [ "$BRANCH" = "HEAD" ]; then
|
||||
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||
fi
|
||||
curl -sSf -X POST "${{ secrets.PHOENIX_DEPLOY_URL }}" \
|
||||
-H "Authorization: Bearer ${{ secrets.PHOENIX_DEPLOY_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"repo\":\"${{ gitea.repository }}\",\"sha\":\"${SHA}\",\"branch\":\"${BRANCH}\",\"target\":\"explorer-live\"}"
|
||||
@@ -12,8 +12,8 @@ useDefault = true
|
||||
|
||||
[[rules]]
|
||||
id = "explorer-legacy-db-password-L@ker"
|
||||
description = "Legacy hardcoded Postgres / SSH password (***REDACTED-LEGACY-PW*** / ***REDACTED-LEGACY-PW***)"
|
||||
regex = '''L@kers?\$?2010'''
|
||||
description = "Legacy hardcoded Postgres / SSH password (redacted). Matches both the expanded form and the shell-escaped form (backslash-dollar) that appeared in scripts/setup-database.sh."
|
||||
regex = '''L@kers?\\?\$?2010'''
|
||||
tags = ["password", "explorer-legacy"]
|
||||
|
||||
[allowlist]
|
||||
|
||||
@@ -20,6 +20,7 @@ That file reflects the live split deployment now in production:
|
||||
- Frontend deploy: [`scripts/deploy-next-frontend-to-vmid5000.sh`](../scripts/deploy-next-frontend-to-vmid5000.sh)
|
||||
- Config deploy: [`scripts/deploy-explorer-config-to-vmid5000.sh`](../scripts/deploy-explorer-config-to-vmid5000.sh)
|
||||
- Explorer config/API deploy: [`scripts/deploy-explorer-ai-to-vmid5000.sh`](../scripts/deploy-explorer-ai-to-vmid5000.sh)
|
||||
- Gitea live redeploy action: [`.gitea/workflows/deploy-live.yml`](../.gitea/workflows/deploy-live.yml), target `explorer-live`
|
||||
- RPC/API-key edge enforcement: [`ACCESS_EDGE_ENFORCEMENT_RUNBOOK.md`](./ACCESS_EDGE_ENFORCEMENT_RUNBOOK.md)
|
||||
- Public health audit: [`scripts/check-explorer-health.sh`](../scripts/check-explorer-health.sh)
|
||||
- Full public smoke: [`check-explorer-e2e.sh`](../../scripts/verify/check-explorer-e2e.sh)
|
||||
|
||||
@@ -63,6 +63,58 @@ initial public review.
|
||||
- Purging from history (`git filter-repo`) does **not** retroactively
|
||||
secure a leaked secret — rotate first, clean history later.
|
||||
|
||||
## History-purge audit trail
|
||||
|
||||
Following the rotation checklist above, the legacy `L@ker$2010` /
|
||||
`L@kers2010` / `L@ker\$2010` password strings were purged from every
|
||||
branch and tag in this repository using `git filter-repo
|
||||
--replace-text` followed by a `--replace-message` pass for commit
|
||||
message text. The rewritten history was force-pushed with
|
||||
`git push --mirror --force`.
|
||||
|
||||
Verification post-rewrite:
|
||||
|
||||
```
|
||||
git log --all -p | grep -cE 'L@ker\$2010|L@kers2010|L@ker\\\$2010'
|
||||
0
|
||||
gitleaks detect --no-git --source . --config .gitleaks.toml
|
||||
0 legacy-password findings
|
||||
```
|
||||
|
||||
### Residual server-side state (not purgable from the client)
|
||||
|
||||
Gitea's `refs/pull/*/head` refs (the read-only mirror of each PR's
|
||||
original head commit) **cannot be force-updated over HTTPS** — the
|
||||
server's `update` hook declines them. After a history rewrite the
|
||||
following cleanup must be performed **on the Gitea host** by an
|
||||
administrator:
|
||||
|
||||
1. Run `gitea admin repo-sync-release-archive` and
|
||||
`gitea doctor --run all --fix` if available.
|
||||
2. Or manually, as the gitea user on the server:
|
||||
```bash
|
||||
cd /var/lib/gitea/data/gitea-repositories/d-bis/explorer-monorepo.git
|
||||
git for-each-ref --format='%(refname)' 'refs/pull/*/head' | \
|
||||
xargs -n1 git update-ref -d
|
||||
git gc --prune=now --aggressive
|
||||
```
|
||||
3. Restart Gitea.
|
||||
|
||||
Until this server-side cleanup is performed, the 13 `refs/pull/*/head`
|
||||
refs still pin the pre-rewrite commits containing the legacy
|
||||
password. This does not affect branches, the default clone, or
|
||||
`master` — but the old commits remain reachable by SHA through the
|
||||
Gitea web UI (e.g. on the merged PR's **Files Changed** tab).
|
||||
|
||||
### Re-introduction guard
|
||||
|
||||
The `.gitleaks.toml` rule `explorer-legacy-db-password-L@ker` was
|
||||
tightened from `L@kers?\$?2010` to `L@kers?\\?\$?2010` so it also
|
||||
catches the shell-escaped form that slipped past the original PR #3
|
||||
scrub (see commit `78e1ff5`). Future attempts to paste any variant of
|
||||
the legacy password — in source, shell scripts, or env files — will
|
||||
fail the `gitleaks` CI job wired in PR #5.
|
||||
|
||||
## Build-time / CI checks (wired in PR #5)
|
||||
|
||||
- `gitleaks` pre-commit + CI gate on every PR.
|
||||
|
||||
@@ -9,6 +9,7 @@ set -euo pipefail
|
||||
|
||||
VMID="${VMID:-5000}"
|
||||
FRONTEND_PORT="${FRONTEND_PORT:-3000}"
|
||||
FORCE_REMOTE_PCT="${FORCE_REMOTE_PCT:-0}"
|
||||
SERVICE_NAME="solacescanscout-frontend"
|
||||
APP_ROOT="/opt/solacescanscout/frontend"
|
||||
PROXMOX_R630_02="${PROXMOX_HOST_R630_02:-192.168.11.12}"
|
||||
@@ -53,7 +54,7 @@ push_into_vmid() {
|
||||
local destination_path="$2"
|
||||
local perms="${3:-0644}"
|
||||
|
||||
if [[ -f /proc/1/cgroup ]] && grep -q "lxc" /proc/1/cgroup 2>/dev/null; then
|
||||
if [[ "$FORCE_REMOTE_PCT" != "1" ]] && [[ -f /proc/1/cgroup ]] && grep -q "lxc" /proc/1/cgroup 2>/dev/null; then
|
||||
install -D -m "$perms" "$source_path" "$destination_path"
|
||||
elif command -v pct >/dev/null 2>&1; then
|
||||
pct push "$VMID" "$source_path" "$destination_path" --perms "$perms"
|
||||
@@ -68,7 +69,7 @@ push_into_vmid() {
|
||||
run_in_vmid() {
|
||||
local command="$1"
|
||||
|
||||
if [[ -f /proc/1/cgroup ]] && grep -q "lxc" /proc/1/cgroup 2>/dev/null; then
|
||||
if [[ "$FORCE_REMOTE_PCT" != "1" ]] && [[ -f /proc/1/cgroup ]] && grep -q "lxc" /proc/1/cgroup 2>/dev/null; then
|
||||
bash -lc "$command"
|
||||
elif command -v pct >/dev/null 2>&1; then
|
||||
pct exec "$VMID" -- bash -lc "$command"
|
||||
|
||||
Reference in New Issue
Block a user