Skip to content

feat(pam): output masking - #499

Merged
lb-vn merged 12 commits into
mainfrom
pam-live-masking
Nov 13, 2026
Merged

lb-vn merged 12 commits into
mainfrom
pam-live-masking

Conversation

@lb-vn

@lb-vn lb-vn commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Description 📣

Adds output masking for postgres and SSH. Supporting PR for Infisical/infisical#9403

Output masking hides values from accidental exposure, such as reads by an AI agent. It isn't a boundary against a user who deliberately transforms data before reading it, so bypasses of that kind are out of scope.

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

  • New or changed commands follow CLI.md, and new commands and flags are recorded in packages/cmd/testdata/command_surface.json
  • Updated AGENTS.md files (if needed)
  • I have read the contributing guide, agreed and acknowledged the code of conduct. 📝

@lb-vn
lb-vn requested a review from bernie-g November 12, 2026 03:55
@infisical-review-police

Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-cli-499-feat-pam-output-masking

Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel.

@veria-ai

veria-ai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

The PR adds output masking for PAM sessions, including a credit-card masking preset for output sent to PostgreSQL and SSH clients.

Nine issues have been addressed, with one masking gap still open. The credit-card preset misses valid 14-digit and 19-digit card numbers, allowing them to reach clients unchanged even when credit-card masking is enabled. This leaves a bounded sensitive-data exposure risk for sessions whose output contains those card lengths.

Open issues (1)

Fixed/addressed: 9 · PR risk: 5/10

Reviews

Comment thread packages/pam/handlers/ssh/proxy.go Resolved
@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge within its stated best-effort scope.

Summary

Adds live output masking for PostgreSQL and SSH.

  • PostgreSQL sessions replace matching result values before clients receive them.
  • SSH sessions mask terminal output before forwarding it.
  • Gateway policies choose which values PostgreSQL and SSH output should hide.

Earlier scope decisions:

  • lb-vn accepted writes in mixed COPY batches rather than parsing SQL.
  • lb-vn accepted duplicate command recordings within 25 ms because the attempted fix dropped silent input.
  • lb-vn accepted anchored-rule misses and title display glitches rather than parsing terminal titles.
  • lb-vn accepted incomplete card-length coverage as best effort.
  • lb-vn accepted escaped PostgreSQL array, JSON, and record values because decoding every format is out of scope.

All supplied previous threads are unnumbered, so previousFindings has no entries.

Reviews (8) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Comment thread packages/pam/handlers/ssh/proxy.go Resolved
Comment thread packages/pam/pam-proxy.go Resolved
Comment thread packages/pam/pam-proxy.go Resolved
Comment thread packages/pam/handlers/ssh/proxy.go Resolved
Comment thread packages/pam/handlers/ssh/proxy.go Resolved
Comment thread packages/pam/session/masking/output.go Resolved
Comment thread packages/pam/pam-proxy.go Resolved
Comment thread packages/pam/session/masking/output.go Resolved
@lb-vn

lb-vn commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

@greptile re-review

@lb-vn
lb-vn merged commit 3d0dfc6 into main Nov 13, 2026
34 of 35 checks passed
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.

2 participants