I've been doing some research on LDAP supportedSASLMechanisms
and am trying to assert whether or not there is confidentiality protection in play when using GSS-SPNEGO
.
My initial assessment is that additional configuration is required to achieve confidentiality because the following C# code (assume GSS-SPNEGO
is selected) only shows SASL GSS-API Integrity
in Wireshark, but no SASL GSS-API Privacy
.
private static void Main()
{
using (var ds = new DirectorySearcher())
{
ds.Filter = string.Format("(&(objectClass=user)(sAMAccountName={0}))", "jdoe");
var result = ds.FindOne(); // Begin packet capture
...
}
}
The following is a sample of packet captures:
client -> server: searchRequest(73) "<ROOT>" baseObject
server <- client: searchResEntry(73) "<ROOT>"
client -> server: bindRequest(75) "<ROOT>" sasl (SASL mechanism: GSS-SPNEGO)
server <- client: bindResponse(75) success
client -> server: SASL GSS-API Integrity: searchRequest(9) "DC=com,DC=example" baseObject
As you can start to see, the entire transaction (beginning with the outgoing searchRequest
query and all subsequent transactions) are sent/received clear text. I do see in the SASL Buffer krb5_blob
under the GSS-API section, albeit just above the GSS-API Payload section which also is clear text.
I guess my main questions are:
- Would a MITM still be able to see the same traffic I'm seeing in clear text and if so, what exactly is Kerberos' role with respect to confidentiality in these transactions (if any)?
- What would be the most preferred route for ensuring encrypted traffic (i.e. EXTERNAL, or SSL/TLS; this part I'm actually still researching implementation details for, specifically in C#, as in
AuthenticationTypes.SecureSocketsLayer
)?
Note: I have not checked "attempt to decrypt KRB5 traffic" nor specified a keytab file in Wireshark, so my initial impression is that the role of Kerberos is for signing/verification purposes only and as mentioned earlier, additional configuration (or coding) would be required to ensure traffic is encrypted.