Skip to content

chore: scrub identifiers from the tree and close the .gitignore gaps - #30

Merged
kyaky merged 1 commit into
mainfrom
chore/repo-hygiene
Aug 26, 2026
Merged

chore: scrub identifiers from the tree and close the .gitignore gaps#30
kyaky merged 1 commit into
mainfrom
chore/repo-hygiene

Conversation

@kyaky

@kyaky kyaky commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Housekeeping found while auditing the repo before pushing. Nothing here is a live credential, and there is nothing to revoke — but all of it is on a public repo today.

Identifiers → documentation space

was now where
z3502076@ad.unsw.edu.au alice@ad.example.edu build_openconnect_cookie doc comment + 3 assertions
ra.vpn.unsw.edu.au ra.vpn.example.com wintun_cleanup module doc
172.26.6.44 / .45 198.51.100.44 / .45 main.rs, gp-tunnel HIP-mismatch docs

The student ID is the one that actually matters — it is an account identifier, and the test only ever needed a username containing @. The others are a real production portal FQDN and two addresses a real gateway assigned from its internal pool; in each case the doc's argument is independent of the value.

(129.94.0.230 / 129.94.0.0/16 in the gp-route tests get the same treatment in #29 — that PR rewrote most of those same lines, so splitting it here would only have produced a conflict.)

The SAML fixture — worth reading before you skim past it

crates/gp-auth/src/saml_common.rs carried a base64 globalprotectcallback: blob that decodes to:

<prelogin-cookie>DKo1IZhfS9/EWg5u3htt…UoiqOg==</prelogin-cookie>
<saml-username>xxxxxxxxxxxx.com</saml-username>

52 bytes of high-entropy data next to a username that had been hand-blanked — the signature of a capture that was only half redacted. I traced it: it is verbatim from yuezk/GlobalProtect-openconnect#431, a public bug report where a third party pasted their callback string and scrubbed the username but not the cookie.

So: not ours, long expired, already public, nothing to revoke. Republishing someone else's bearer token as a test fixture is still not something to leave in place. Replaced with a synthetic blob of identical shape and element order; verified it round-trips through the same parser and the assertions still exercise the same path.

.gitignore — three gaps, each confirmed with git check-ignore -v

1. /target was root-anchored. So crates/*/target/ and bins/*/target/ were not ignored, and two per-crate rules had been bolted on after the fact. That is exactly how 710 blobs of Windows build output (58 MiB of pack) reached this repo's history. One un-anchored target/ covers every depth, now and for whatever gets added later.

2. A bare config.toml matches at every depth — including .cargo/config.toml, which this repo has a real use for (release.yml sets OPENCONNECT_DIR / LIBCLANG_PATH per job; the natural refactor is a checked-in [env] block). A git add would have silently done nothing and CI would have failed on a linker error with no hint pointing at .gitignore. Now anchored — and config.toml.tmp is covered too, which Config::save_to writes before its rename and which holds the portal URL, username and Okta tenant.

3. No release-packaging output was ignored (dist/, dll-cache/, wintun-extract/, the tarballs). Reproducing a release build locally — the obvious move when a release job fails — leaves a directory of binaries next to a git add -A.

The credential globs stay deny-by-default but now re-admit **/tests/fixtures/**. PortalProfile already has client_cert / client_key fields and client-certificate auth is a planned item, so a synthetic fixture cert is a near-term certainty — and it would currently fail to stage with no visible reason.

Verified git ls-files | git check-ignore --stdin is empty: no currently-tracked file becomes ignored.

Verification

cargo test --workspace --locked → 268 passed · cargo clippy --workspace --all-targets -- -D warnings → clean · cargo fmt --all --check → clean

Two things this cannot fix — your call

Both need git filter-repo and a force-push, which rewrites every SHA and breaks open PRs and existing clones. Deliberately not attempted:

  1. frank.li@unsw.edu.au is the author and committer of 28 of 186 commits. Commit metadata is not reachable by editing files — a .mailmap changes local git log rendering, but GitHub still serves the original author line on every commit page and through the API. Fixing it means git filter-repo --mailmap. (andylizf@outlook.com should be left alone — that is an outside contributor's own chosen identity.)
  2. bins/pgn-tray/target/ still holds those 710 blobs, including 25 .pdb files embedding C:\Users\kyaky\Documents\Playground\pangolin\…. Dropping them also takes ~58 MiB off every future clone.

Related: the message on 8572dfb ("security: remove session archives from repo") is wrong in both directions. It claims the archives were removed from tracking and remain in history; in fact git show --stat shows it changed .gitignore and nothing else, and .session-archives/ has never existed anywhere in history. The ignore rule is correct and preventive, so it stays — but no BFG pass is needed for it. The two items above are the real ones.

Housekeeping found while auditing the repo before pushing. None of it
is a live credential; all of it is on a public repo today.

Identifiers replaced with documentation-space equivalents:

  * `z3502076@ad.unsw.edu.au` — a real student ID and institutional
    address — appeared in a doc comment on `build_openconnect_cookie`
    and in three assertions of the percent-encoding test. The test only
    needs a username containing `@`; it now uses `alice@ad.example.edu`.
  * `ra.vpn.unsw.edu.au`, a real production GlobalProtect portal FQDN,
    was quoted in a libopenconnect log excerpt in `wintun_cleanup`.
    Nothing in that doc's argument depends on the hostname — the point
    is that libopenconnect names the adapter after the portal.
  * `172.26.6.44` / `172.26.6.45`, addresses a real gateway assigned
    from its internal pool, illustrated the pre-CSTP vs CSTP HIP
    mismatch in `main.rs` and `gp-tunnel`. The argument is entirely
    about the two differing, so RFC 5737 space works identically.

The SAML callback fixture in `gp-auth` is the one worth explaining. It
carried a 52-byte high-entropy `prelogin-cookie` next to a username
that had been hand-blanked to `xxxxxxxxxxxx.com` — the signature of a
capture that was only half redacted. It traces to a public upstream bug
report (yuezk/GlobalProtect-openconnect#431), so it is a third party's
long-expired session token rather than ours, and there is nothing to
revoke. Republishing someone else's bearer token as a test fixture is
still not something to leave in place. Replaced with a synthetic blob
of identical shape and element order; verified it round-trips.

`.gitignore` had three gaps, each confirmed with `git check-ignore -v`:

  * `/target` was root-anchored, so `crates/*/target/` and
    `bins/*/target/` were NOT ignored — two per-crate rules had been
    added reactively after the fact. That is exactly how 710 blobs of
    Windows build output (58 MiB of pack) reached this repo's history.
    One un-anchored `target/` covers every depth, now and later.
  * A bare `config.toml` line matches at every depth, so it also
    swallowed `.cargo/config.toml` — which this repo has a real use for
    (release.yml sets OPENCONNECT_DIR / LIBCLANG_PATH per job, and the
    natural refactor is a checked-in `[env]` block). A `git add` would
    have silently done nothing. Now anchored, and `config.toml.tmp` —
    written by `Config::save_to` before its rename, containing the
    portal URL, username and Okta tenant — is covered too.
  * None of the release-packaging output (`dist/`, `dll-cache/`,
    `wintun-extract/`, the tarballs) was ignored, so reproducing a
    release build locally leaves a directory of binaries next to a
    `git add -A`.

The credential globs (`*.pem`, `*.key`, `*.log`, …) stay deny-by-
default but now re-admit `**/tests/fixtures/**`: `PortalProfile`
already has `client_cert` / `client_key` fields and client-certificate
auth is a planned item, so a synthetic fixture cert is a near-term
certainty and would otherwise fail to stage with no visible reason.

Verified `git ls-files | git check-ignore --stdin` is empty — no
currently-tracked file becomes ignored.

  cargo test --workspace --locked -> 268 passed, 0 failed
  cargo clippy --workspace --all-targets -- -D warnings -> clean
  cargo fmt --all --check -> clean

Not addressed here, needs a decision: `frank.li@unsw.edu.au` is the
author AND committer of 28 of 186 commits, and `bins/pgn-tray/target/`
still holds those 710 build blobs (with `C:\Users\kyaky\…` paths in the
.pdb files). Neither can be fixed by editing files — both need a
`git filter-repo` pass and a force-push, which rewrites every SHA and
breaks open PRs, so it is deliberately left as a separate call.
@kyaky
kyaky force-pushed the chore/repo-hygiene branch from cbbc861 to 200a0df Compare August 26, 2026 12:36
@kyaky
kyaky merged commit 602307c into main Aug 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant