Skip to content

Commit

Permalink
Set the security level of Windows named pipes to PrivacyAndIntegrity
Browse files Browse the repository at this point in the history
Communication over named pipes on Windows is local IPC.
  • Loading branch information
irsl committed Feb 5, 2024
1 parent a3f5ed6 commit c0770ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions credentials/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func getSecurityLevel(network, addr string) (credentials.SecurityLevel, error) {
// Local TCP connection
case strings.HasPrefix(addr, "127."), strings.HasPrefix(addr, "[::1]:"):
return credentials.NoSecurity, nil
// Windows named pipe connection
case network == "pipe" && strings.HasPrefix(addr, `\\.\pipe\`):
return credentials.PrivacyAndIntegrity, nil
// UDS connection
case network == "unix":
return credentials.PrivacyAndIntegrity, nil
Expand Down

0 comments on commit c0770ef

Please sign in to comment.