-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
[stealth 04/11] Add stealth artifact leakage checks #8777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
reflog
wants to merge
9
commits into
main
Choose a base branch
from
stealth/8766-leakage-checks-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1f07bc2
Add stealth leakage checks
reflog f7c7afd
Make stealth leakage CI strict
reflog 7dc2517
Harden stealth leakage scanning
reflog 2eabd76
Wire stealth leakage checks through release workflow
reflog b63f589
fix: avoid leakage scanner self-failures
reflog b640bbe
fix: improve leakage scanner reporting
reflog 08dfc9a
fix: scan zip metadata without duplicate entries
reflog 6d45892
fix: scan zip local header metadata
reflog 45734dd
fix: fail corrupt nested archives
reflog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Stealth Leakage Checks | ||
|
|
||
| `scripts/stealth/check_leakage.py` scans built stealth artifacts for normal | ||
| Lantern identifiers. It accepts APK, AAB, ZIP-like archives, and unpacked build | ||
| directories. Archive entries are scanned recursively, and string matching checks | ||
| UTF-8, UTF-16LE, and UTF-16BE encodings. | ||
|
|
||
| Run the default stealth check: | ||
|
|
||
| ```sh | ||
| make stealth-leakage-check \ | ||
| STEALTH_LEAKAGE_PATHS="path/to/app.apk path/to/app.aab" | ||
| ``` | ||
|
|
||
| Run the stricter no-VPN variant: | ||
|
|
||
| ```sh | ||
| make stealth-novpn-leakage-check \ | ||
| STEALTH_LEAKAGE_PATHS="path/to/app.apk" | ||
| ``` | ||
|
|
||
| If the configured targets are absent, the Make targets skip successfully. This | ||
| keeps normal builds and ordinary CI runs from failing on stealth-only checks. | ||
|
|
||
| ## Modes | ||
|
|
||
| The forbidden-token config lives at | ||
| `scripts/stealth/forbidden_tokens.json`. | ||
|
|
||
| `stealth` checks for: | ||
|
|
||
| - normal Lantern package, brand, library, service, and organization identifiers | ||
| - user-facing VPN strings | ||
| - OAuth provider strings and method-channel entry points | ||
| - billing and subscription entry points | ||
| - app-link hosts, custom schemes, and deep-link paths | ||
| - Lantern social/support URLs | ||
| - update feed and release URLs | ||
|
|
||
| `stealth-novpn` extends `stealth` and also checks Android VPN/TUN surfaces such | ||
| as `android.net.VpnService`, `BIND_VPN_SERVICE`, `TunOptions`, and VPN quick | ||
| tile/service actions. | ||
|
|
||
| ## Allowlists | ||
|
|
||
| Each mode supports an `allowlist` in the JSON config. Allowlist entries can | ||
| match by `token`, `category`, `location` glob, and `encoding`. Example: | ||
|
|
||
| ```json | ||
| { | ||
| "token": "Lantern", | ||
| "location": "*.SF", | ||
| "reason": "example only" | ||
| } | ||
| ``` | ||
|
|
||
| Keep allowlist entries narrow and mode-specific so real leaks still fail the | ||
| scan. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.