#21103: Android/Security: exclude device identity from backups
app: android
size: XS
Cluster:
Security Enhancements and Fixes
This PR reopens the Android backup identity exclusion work from the previously closed PR after branch-name cleanup.
Summary:
- Exclude `openclaw/identity` from Android backup/data-transfer rules.
- Add regression coverage for backup/data extraction XML rules.
Note:
- This branch currently includes the secure transport commit lineage as prepared previously.
Replaces: #21070
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Excludes `openclaw/identity` from Android cloud backup and device-transfer rules, and enforces TLS for all non-loopback gateway connections.
- Added exclusion rules to `backup_rules.xml` and `data_extraction_rules.xml` to prevent device identity material from being backed up
- Added `BackupRulesTest.kt` with regression coverage for backup exclusions
- Implemented TLS enforcement in `ConnectionManager`, `GatewaySession`, and `NodeRuntime` - non-loopback connections now require TLS
- Added `isLoopbackHost()` helper to detect localhost/127.x/::1 addresses
- Updated `ConnectionManagerTest.kt` with comprehensive test coverage for TLS enforcement logic
<h3>Confidence Score: 5/5</h3>
- Safe to merge with minimal risk
- Security-focused PR with proper backup exclusions and TLS enforcement. Well-tested with comprehensive unit tests covering both backup rules and TLS enforcement logic. Changes are defensive, preventing plaintext connections to non-loopback hosts and excluding sensitive identity data from backups. Only minor code duplication noted.
- No files require special attention
<sub>Last reviewed commit: b45edc4</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21102: Android/Security: require TLS for non-loopback gateway sessions
by bmendonca3 · 2026-02-19
73.6%
#15951: fix: Android production build permits cleartext traffic globally
by coygeek · 2026-02-14
68.1%
#10508: fix(android): fix identity signature failure on Android devices
by kilbertert · 2026-02-06
68.0%
#13988: feat(backup): add backup/restore CLI with local + S3 storage
by n24q02m · 2026-02-11
66.0%
#11205: Android: fix gateway connection and canvas URL for Tailscale serve
by emonty · 2026-02-07
65.9%
#5867: Android: Add BouncyCastle Ed25519 fallback and gateway token UI
by brandonpollack23 · 2026-02-01
65.6%
#10597: fix(android): add BouncyCastle fallback for Ed25519 on Samsung devices
by bingluo-coder · 2026-02-06
64.9%
#20877: Store config backups in their own directory
by pierreeurope · 2026-02-19
63.9%
#23361: Gateway: reject scope assertions without identity binding
by bmendonca3 · 2026-02-22
63.0%
#13321: android/gateway: harden manual connect identity and A2UI UX
by m888m · 2026-02-10
62.8%