Apply complete data masking rules to RDP - #1717
Conversation
🤖 Generated with Mister Maluco Co-Authored-By: MisterMal <teskeslab@lucasteske.dev>
Migration Safety AnalysisNo database migrations were changed in this PR. Safe to deploy to sandbox. |
PR Summary by QodoApply complete connection Data Masking rules to agent-side RDP live masking
AI Description
Diagram
High-Level Assessment
Files changed (12)
|
📋 API ChangelogAPI Changelog unknown vs. unknownNo changes detected |
Code Review by Qodo
1.
|
|
✅ Build Completed with Success, Version=1717.0.0-g0f3dc76 |
🤖 Generated with Mister Maluco Co-Authored-By: MisterMal <teskeslab@lucasteske.dev>
|
✅ Build Completed with Success, Version=1717.0.0-g1fc5d3d |
Description
Apply each RDP connection's complete Data Masking policy in the agent, including supported entities, custom regex/deny-list matchers, and per-rule score thresholds.
SessionStarted, negotiate complete-policy support explicitly, and fail closed for incompatible agents.ad_hoc_recognizersfor custom entities while preserving deterministic supported-entity and threshold semantics.User-facing impact
RDP live masking now honors the supported and custom entities configured on the selected connection instead of using gateway-wide entity settings.
How to test
Automated
Expected: all three Go packages pass; the Rust PII-gate suites pass, including complete-policy parsing, custom recognizer serialization, invalid-policy fail-closed behavior, and stale capability lifecycle coverage.
Local RDP flow
Build and start the local stack:
Assign an active Live Data Masking rule to an RDP connection. Select
PERSONandDATE_TIME, then add this regex-only custom entity:{"name":"FIXTURE_REGEX","regex":"rdp-gold-fixture-[0-9]{4}","deny_list":[],"score":0.8}Display
rdp-gold-fixture-2026, a person name, and a date on the target desktop, then open the connection's RDP web client.Expected: the gateway logs
piigate: agent-side guard active; a detection includesFIXTURE_REGEX; the matching fixture and date/name regions are blacked out while the session remains usable under the defaultredactpolicy.Negative path
Connect through an older agent that does not advertise
supports_pii_data_masking_rules, or pass malformed complete-policy metadata in the Rust resolver tests.Expected: the gateway refuses delegation to the older agent, and malformed complete policy returns an error instead of falling back to partial entity metadata.
Verification performed
Go and Rust focused suites passed locally. A rebuilt local gateway/agent stack detected
PERSON,DATE_TIME, and regex-onlyFIXTURE_REGEX; the matching RDP regions were visibly redacted. Agent violation persistence still exposes the pre-existing broker-session/database-session ID mismatch and is not changed by this PR.Automated by MisterMal