Commit d3bcc83
fix(security): enforce SSH-only git remotes estate-wide (standards#69) (#147)
## Summary
- Wires token-in-URL detection into `governance-reusable.yml`
(`security-policy` job) as a new **SSH-remote policy** step: scans every
`.git/config` present in the checkout tree for `x-access-token:`,
`gho_`, `ghp_`, `ghs_`, and `github_pat_` credentials embedded in HTTPS
remote URLs; fails hard on any hit. All downstream repos that call the
governance bundle inherit this check automatically via the single
`uses:` delegation.
- Updates `REMOTE-URL-POLICY.adoc` (→ v1.1.0): records the 2026-05-19
recursive audit (1 offender found and remediated locally), upgrades the
detection one-liner to recurse all `.git` trees rather than just
`~/dev/*/`, and expands the Enforcement section with the CI gate
reference, a recommended pre-push hook, and provisioning guidance.
## Audit result (2026-05-19)
Full recursive sweep of ~130 `.git/config` files under
`/home/hyperpolymath/dev` (repos, scratch, tools, worktrees, audit
clones):
| Repo | Remote | Masked URL | Action |
|---|---|---|---|
| `dev/repos/file-soup` | `origin` |
`https://x-access-token:gho_****@github.com/hyperpolymath/file-soup` |
Switched to `git@github.com:hyperpolymath/file-soup.git` (local
.git/config only) |
All other repos were already on SSH or plain HTTPS (no embedded
credential).
## Outstanding owner action (EXTERNAL — not resolved by this PR)
**Token rotation required.**
The token `gho_****` (prefix `gho_1q9dB2…`) was found in
`dev/repos/file-soup/.git/config`. A token that has appeared in a URL is
considered compromised regardless of whether it was pushed. The owner
must revoke/rotate it at:
https://github.com/settings/tokens
This is a manual browser action; it cannot be automated here.
## Test plan
- [ ] CI passes on this PR (governance-reusable SSH-remote policy step
shows ✅)
- [ ] Manually verify `git remote -v` in `dev/repos/file-soup` shows SSH
form
- [ ] Owner rotates the exposed token at github.com/settings/tokens
- [ ] Human review + merge (no `--admin`; Refs not Closes)
Refs #69
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 4044ece commit d3bcc83
2 files changed
Lines changed: 85 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
301 | 324 | | |
302 | 325 | | |
303 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
76 | 95 | | |
77 | 96 | | |
78 | 97 | | |
| |||
85 | 104 | | |
86 | 105 | | |
87 | 106 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
0 commit comments