Skip to content

feat: fail-closed guard against proprietary source in this public repo - #160

Open
marc-n-dream wants to merge 3 commits into
masterfrom
feat/proprietary-source-guard
Open

feat: fail-closed guard against proprietary source in this public repo#160
marc-n-dream wants to merge 3 commits into
masterfrom
feat/proprietary-source-guard

Conversation

@marc-n-dream

Copy link
Copy Markdown
Collaborator

Why

This repository is public. The Android and webview repos that feed it are private, and only
compiled artifacts (.aar, .aar.tmpl, .unitypackage, .bundle) plus accepted glue
(.cs, .jslib, .mm) are supposed to cross the boundary. A leak of native source here is
irreversible, so the bar is "a routine mistake cannot leak it" — not "reviewers will notice".

What

  • scripts/check-proprietary-source.sh — denylist guard, bash 3.2 safe. Blocks *.java/*.kt
    (plus .orig/.bak/~ variants), *.gradle, *.pro, *.sh, *.toml, Rakefile/*.rake,
    the gradle wrapper, .gitmodules, AndroidManifest.xml and src/main/res/. Allowlists Unity
    gradle templates, the guard script itself, and content-free *.meta.
  • .githooks/pre-commit — local gate. Enable with git config core.hooksPath .githooks.
  • .github/workflows/no-proprietary-source.yml — the authoritative gate. Runs on every push and
    PR, and additionally rejects submodule gitlinks so the private repos can never be referenced
    from here.
  • AGENTS.md — documents the boundary.

Limits

The guard is path-based. It cannot catch native source pasted into an accepted file (.cs, .md).
Documented rather than fixed.

Verification

Guard block/allow paths exercised directly, and again through the cross-repo webview sync with a
planted .java in the payload — the sync aborts. An adversarial review pass closed 10 bypasses
before this branch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ShCMtnweyHuUEJQn2EH5d6

marc-n-dream and others added 3 commits July 10, 2026 03:49
Block native (Java/Kotlin) source, the private Gradle build system, and the
private build pipeline from this public repo. Native code ships only as
compiled .aar/.unitypackage/.bundle artifacts; the source lives in the
private airconsole-unity-android-plugin and airconsole-unity-webview repos.

Denylist (scripts/check-proprietary-source.sh, bash 3.2 safe):
- *.java/*.kt/*.kts, *.gradle, *.pro, gradle wrapper/properties
- *.sh/Rakefile/*.rake build scripts, *.toml version catalogs
- AndroidManifest.xml, src/main/res/, .gitmodules
- source patterns also match backup/merge suffixes (.orig/.bak/~/.txt)
Allowlist: Unity gradle templates, this script, content-free *.meta.

Layers:
- .githooks/pre-commit: fast local gate (git config core.hooksPath .githooks)
- .github/workflows/no-proprietary-source.yml: authoritative CI gate on every
  push (any branch) and PR, plus a submodule-gitlink rejection
- .gitignore: ignore *.orig/*.bak/*~ so leaked source is not staged at all
- AGENTS.md: contributor rules + hook install

Denylist and layering verified against an adversarial red-team of the two
private repos' full file inventory (10 confirmed gaps closed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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