Skip to content

feat: ssh pam#57

Merged
sheensantoscapadngan merged 4 commits into
mainfrom
feat/ssh-pam
Nov 18, 2025
Merged

feat: ssh pam#57
sheensantoscapadngan merged 4 commits into
mainfrom
feat/ssh-pam

Conversation

@sheensantoscapadngan
Copy link
Copy Markdown
Member

@sheensantoscapadngan sheensantoscapadngan commented Nov 12, 2025

Description 📣

This PR adds SSH PAM (Privileged Access Management) support to the Infisical CLI, enabling users to establish SSH sessions through the Infisical Gateway with automatic credential injection and session recording.

Type ✨

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

Tests 🛠️

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

@sheensantoscapadngan sheensantoscapadngan marked this pull request as ready for review November 13, 2025 14:39
@sheensantoscapadngan sheensantoscapadngan changed the title feat: ssh pam v1 feat: ssh pam Nov 13, 2025
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Nov 13, 2025

Greptile Summary

  • Implements SSH PAM support with automatic credential injection, session recording, and transparent proxy architecture for privileged access management
  • Introduces critical security vulnerabilities: unauthenticated client access (NoClientAuth: true) and MITM-vulnerable target connections (ssh.InsecureIgnoreHostKey())
  • Stores sensitive credentials (passwords, private keys) in memory without explicit zeroing, vulnerable to memory dumps

Confidence Score: 1/5

  • This PR introduces critical authentication and encryption bypass vulnerabilities that make it unsafe for production deployment
  • Score reflects multiple critical security issues: NoClientAuth allows anyone with localhost access to use injected credentials, InsecureIgnoreHostKey enables MITM attacks on target servers, and credentials remain in memory without secure handling. These vulnerabilities could lead to unauthorized access and credential theft.
  • packages/pam/handlers/ssh/proxy.go requires immediate security hardening before deployment

Important Files Changed

Filename Overview
packages/pam/handlers/ssh/proxy.go Critical security vulnerabilities: NoClientAuth: true allows unauthenticated access and ssh.InsecureIgnoreHostKey() enables MITM attacks
packages/pam/local/ssh-proxy.go Launches SSH client with disabled host key verification; transparent credential injection via local proxy
packages/pam/session/credentials.go Manages credential caching in memory; credentials remain in-memory throughout session lifecycle
packages/api/model.go Added SSH credential fields and interface{} type for flexible log format, reducing type safety

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, 5 comments

Edit Code Review Agent Settings | Greptile

Comment thread packages/pam/handlers/ssh/proxy.go Outdated
Comment thread packages/pam/handlers/ssh/proxy.go
Comment thread packages/pam/handlers/ssh/keys.go
Comment thread packages/api/model.go
Comment thread packages/pam/local/ssh-proxy.go
Comment thread packages/pam/session/logger.go
@x032205
Copy link
Copy Markdown
Member

x032205 commented Nov 18, 2025

@greptile review this

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. packages/pam/session/credentials.go, line 84-95 (link)

    logic: SECURITY: Sensitive credentials stored in memory without explicit zeroing after use.

    SSH private keys and passwords remain in memory (lines 89, 87) until garbage collected. If the process memory is dumped or swapped to disk, credentials could be exposed. In Go, strings are immutable and can't be reliably zeroed.

    Consider adding explicit cleanup with secure memory handling patterns, or document that operators should prevent core dumps and memory swapping on systems running PAM sessions.

11 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

Comment thread packages/pam/local/ssh-proxy.go
Comment thread packages/api/model.go
@sheensantoscapadngan sheensantoscapadngan merged commit 55008a8 into main Nov 18, 2025
4 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