Skip to content

feat(pam): NTLM authentication for MSSQL proxy#241

Open
saifsmailbox98 wants to merge 6 commits into
mainfrom
saif/pam-226-add-ntlm-auth-support-for-mssql-in-pam
Open

feat(pam): NTLM authentication for MSSQL proxy#241
saifsmailbox98 wants to merge 6 commits into
mainfrom
saif/pam-226-add-ntlm-auth-support-for-mssql-in-pam

Conversation

@saifsmailbox98
Copy link
Copy Markdown
Contributor

@saifsmailbox98 saifsmailbox98 commented May 20, 2026

Description 📣

Gateway MSSQL proxy can now perform NTLM authentication with the target SQL Server when the account is configured for Windows auth. Uses go-ntlmssp for the handshake; the client-to-gateway leg remains unchanged.

Infisical/infisical#6544

Type ✨

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

Tests 🛠️

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

Gateway MSSQL proxy now supports NTLM (Windows Authentication) in
addition to SQL auth. When AuthMethod is "ntlm", the proxy performs
a 3-message NTLM handshake with the server (negotiate, challenge,
authenticate) using go-ntlmssp, instead of sending SQL credentials
in LOGIN7.

The client-to-gateway leg is unchanged — clients always use SQL auth
with dummy credentials, and the proxy injects the real NTLM auth on
the server leg.
@linear
Copy link
Copy Markdown

linear Bot commented May 20, 2026

PAM-226

@infisical-review-police
Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-cli-241-feat-pam-ntlm-authentication-for-mssql-proxy

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

Comment thread packages/pam/handlers/mssql/proxy.go Outdated
Comment thread packages/pam/handlers/mssql/tds.go
…x SSPI length sentinel

Extract SSPI token before checking for error tokens — the NTLM
challenge contains random binary that can match the 0xAA error byte.
Also fix the SSPI length boundary: 0xFFFF is a sentinel per TDS spec,
so use strict less-than.
@saifsmailbox98
Copy link
Copy Markdown
Contributor Author

@claude review once

Comment thread packages/pam/handlers/mssql/proxy.go
Comment thread packages/pam/handlers/mssql/proxy.go Outdated
go-ntlmssp uses splitNameForAuth to extract domain from the username.
Without the DOMAIN\ prefix, the domain is empty in the NTLMv2 hash
and authenticate message, which may fail on domain-member SQL Servers
authenticating against a remote DC.
@saifsmailbox98 saifsmailbox98 requested a review from x032205 May 20, 2026 12:19
@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 27, 2026

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9387833 Triggered Generic Password c15a998 packages/pam/handlers/rdp/native/src/rdcleanpath.rs View secret
33062794 Triggered Generic CLI Secret c15a998 packages/cmd/login_status_test.go View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

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.

1 participant