Skip to content

Prevent cross-gateway asset data leakage - #3547

Draft
wborn wants to merge 3 commits into
mainfrom
gateway-data-leakage
Draft

wborn wants to merge 3 commits into
mainfrom
gateway-data-leakage

Conversation

@wborn

@wborn wborn commented Nov 5, 2026

Copy link
Copy Markdown
Member

Description

  • Introduce V2 asset ID mapping using all 22 characters of the gateway ID to reduce mapping collisions
  • Preserve legacy V1 mapping for gateways registered before the upgrade to version 1.34.0
  • Track first activation timestamps of normalized application versions to maintain a stable mapping cutoff across upgrades, restarts and rollbacks
  • Enforce gateway asset ownership for creates, updates, deletions and attribute events using persisted asset ancestry
  • Add database locking to prevent concurrent changes from bypassing ownership checks
  • Reject conflicting asset IDs and invalid synchronization inventories to prevent unintended asset modifications or deletions
  • Abort gateway synchronization when asset operations fail instead of continuing with inconsistent state
  • Add unit and integration tests covering ID mapping, version tracking, ownership isolation and synchronization failures

Closes #2427

Checklist

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated

@wborn wborn added the Bug Error or issue in the system label Nov 5, 2026
- Introduce V2 asset ID mapping using all 22 characters of the gateway ID to reduce mapping collisions
- Preserve legacy V1 mapping for gateways registered before the upgrade to version 1.34.0
- Track first activation timestamps of normalized application versions to maintain a stable mapping cutoff across upgrades, restarts and rollbacks
- Enforce gateway asset ownership for creates, updates, deletions and attribute events using persisted asset ancestry
- Add database locking to prevent concurrent changes from bypassing ownership checks
- Reject conflicting asset IDs and invalid synchronization inventories to prevent unintended asset modifications or deletions
- Abort gateway synchronization when asset operations fail instead of continuing with inconsistent state
- Add unit and integration tests covering ID mapping, version tracking, ownership isolation and synchronization failures

Closes #2427
wborn added 2 commits November 6, 2026 12:13
- Serialize empty asset inventories so gateways can complete valid empty syncs
- Use inserts for gateway assets to prevent ID collisions from overwriting existing assets
- Add regression tests for inventory serialization and independent asset creation
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Error or issue in the system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent gateway descendant asset data leakage

2 participants