harness: read Syncro keys from vault, stop hardcoding the repo root
Two defects found while running /wiki-compile, both from tooling assuming
a path instead of resolving it.
1. Plaintext Syncro API keys. Mike's and Howard's live PSA keys were
copy-pasted into three command files, a script, and two catalog docs --
despite both already being vaulted at msp-tools/syncro and
msp-tools/syncro-howard. Replaced with reads from the SOPS vault via a
new sourced helper, .claude/scripts/syncro-env.sh. Write paths fail
closed; read-only paths degrade to skipped enrichment rather than a
wrong key. Per-user mapping is unchanged, so Syncro attribution is too.
2. Hardcoded repo root. wiki-compile/wiki-lint/inject-standards and
gen_b64.py hardcoded D:/claudetools; this machine is C:/claudetools.
syncro.md also read ~/.claude/identity.json before the repo copy -- the
same bug that made remediation-tool's consent-audit report a fully
consented tenant as RED. Root now resolves from the script's own
location, with identity.json claudetools_root as the override.
get-identity.sh had a chicken-and-egg bug: it read ${CLAUDETOOLS_ROOT:-.}
but never set it, so every caller had to already know the root. It now
self-resolves and exports CLAUDETOOLS_ROOT + VAULT_ROOT.
Verified: all three command setup blocks authenticate against live Syncro;
get-identity.sh works from any cwd and honors a pre-set root; gps-rmm
autoenroll resolves its key from the vault. security-review: no findings.
NOTE: both keys remain valid in git history. Rotation in the Syncro portal
is the required follow-up -- this commit does not resolve that exposure.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""Generate base64 of the WatchdogAlertsSection component."""
|
||||
import base64, sys
|
||||
import base64, os, sys
|
||||
|
||||
BT = chr(96)
|
||||
BULLET = "\xb7"
|
||||
@@ -195,7 +195,9 @@ lines = [
|
||||
component = "".join(lines)
|
||||
b64 = base64.b64encode(component.encode("utf-8")).decode("ascii")
|
||||
|
||||
with open("D:/claudetools/.claude/scripts/component.b64", "w") as f:
|
||||
# Write next to this script — the repo root is machine-specific, never hardcode it.
|
||||
out_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "component.b64")
|
||||
with open(out_path, "w") as f:
|
||||
f.write(b64)
|
||||
|
||||
print(f"Component: {len(component)} chars")
|
||||
|
||||
Reference in New Issue
Block a user