Hello,
Our organization will soon disable LDAP on port 389 and enforce LDAPS (port 636) for all Active Directory authentication. We are seeking clarification on how this change may impact our ABP Zero (v6.0.0) application running on .NET 5. Below is the core project configuration:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>1.0.0.0</VersionPrefix>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Epl.Core</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Abp.ZeroCore.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Abp.Zero.Ldap" Version="6.0.0" />
<PackageReference Include="Abp.AutoMapper" Version="6.0.0" />
<!-- (Other package references omitted for brevity) -->
</ItemGroup>
</Project>
Our Current Authentication Setup
IIS Windows Authentication, with Kerberos enabled ABP Zero default authentication + JWT token generation No custom LDAP overrides or implementation Although Abp.Zero.Ldap is referenced, the application does not call LDAP directly appsettings.json currently contains (We DO NOT specify any LDAP URLs or Port info):
"LDAP": {
"DisableWindowsAuth": false
}
Questions for ABP:
- Will disabling LDAP (389) affect our application? Given:
We rely fully on IIS Windows Authentication ABP's LDAP settings appear to have LDAP disabled by default We explicitly set "DisableWindowsAuth": false in configuration We do not use LDAP login sources
We need confirmation whether ABP makes any internal LDAP bind calls when DisableWindowsAuth is false, or whether the presence of Abp.Zero.Ldap alone triggers any directory lookups.
- Do we need code changes to support LDAPS (636)? Documentation for LDAPS suggests needing to:
Override CreatePrincipalContext Use secure ContextOptions (like SecureSocketLayer) Specify LDAPS server URLs/ports
But if IIS/Kerberos fully handles user authentication, we want to confirm ABP will not attempt LDAP binds and thus does not require any LDAPS customization.
- Recommended way to test LDAPS only We would appreciate guidance on proper test steps:
Is it valid to disable port 389 on a development Domain Controller to simulate LDAPS only conditions? Will ABP Zero function normally under LDAPS only if Windows Authentication is the only login method? Are there any ABP logs or configuration entries we should monitor to confirm no LDAP activity?
Goal We want confirmation on whether:
No changes are required because IIS/Kerberos handles authentication entirely, or We must implement custom LDAPS configuration within the ABP Zero Ldap module.
Any guidance or official recommendations would be very helpful.
Thank you.
1 Answer(s)
-
0
Hi @tom.ohle
Thank you for reaching out and providing such a detailed breakdown of your setup. Securing your infrastructure by enforcing LDAPS (port 636) and disabling standard LDAP (port 389) is a great proactive measure, and we are happy to help you navigate this transition for your ABP Zero application.
Here are the answers to your questions, along with the recommended approach to ensure your application functions flawlessly under the new security policies.
Will disabling LDAP (389) affect our application?
If your application relies entirely on IIS Windows Authentication (Kerberos) and you have not explicitly enabled the ABP LDAP module in your core module's
PreInitializemethod (e.g., viaConfiguration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource));), ABP will not make any implicit internal LDAP binds or directory lookups.The mere presence of the
Abp.Zero.LdapNuGet package does not trigger active directory lookups. If you are exclusively using IIS for authentication and JWT generation, disabling port 389 will not break your current login flow.However, if your application does use the ABP LDAP module as an external authentication source (even as a fallback) to validate credentials or synchronize users, you will need to update your code to support LDAPS.
Do we need code changes to support LDAPS (636)?
Since you are on ABP v6.0.0, the native configuration setting for LDAPS (
UseSsl) was introduced in a later version ([PR #6655](https://github.com/aspnetboilerplate/aspnetboilerplate/pull/6655/changes#diff-ab614034a21e9bfaa788d7d322ad37b48f0c528d68ef9feadd4bf0230198495eR148)).The good news is that you do not need to upgrade your ABP packages to support this. You can easily apply the logic from that PR directly in your v6.0.0 codebase by replacing the default
LdapAuthenticationSourcewith a custom implementation.If you plan to utilize ABP's LDAP module under an LDAPS only environment, you should implement the following override:
Step A: Create a Custom Authentication Source Create a new class that inherits from
LdapAuthenticationSourceand override theCreatePrincipalContextmethod to enforce theSecureSocketLayercontext option.namespace Epl.Ldap { public class CustomLdapAuthenticationSource : LdapAuthenticationSource<Tenant, User> { private readonly ILdapSettings _settings; public CustomLdapAuthenticationSource(ILdapSettings settings, IAbpZeroLdapModuleConfig ldapModuleConfig) : base(settings, ldapModuleConfig) { _settings = settings; } protected virtual async Task<PrincipalContext> CreatePrincipalContext(Tenant tenant) { // Note: Ensure your custom settings implementation supports GetUseSsl() var useSsl = await _settings.GetUseSsl(tenant?.Id); var contextType = await _settings.GetContextType(tenant?.Id); var options = useSsl ? ContextOptions.SecureSocketLayer | ContextOptions.Negotiate : GetDefaultOptionForStore(contextType); return new PrincipalContext( contextType, ConvertToNullIfEmpty(await _settings.GetDomain(tenant?.Id)), ConvertToNullIfEmpty(await _settings.GetContainer(tenant?.Id)), options, ConvertToNullIfEmpty(await _settings.GetUserName(tenant?.Id)), ConvertToNullIfEmpty(await _settings.GetPassword(tenant?.Id)) ); } private ContextOptions GetDefaultOptionForStore(ContextType contextType) { if (contextType == ContextType.Machine) { return ContextOptions.Negotiate; } return ContextOptions.Negotiate | ContextOptions.Signing | ContextOptions.Sealing; } } }Step B: Register the Custom Source In your Core module's
PreInitializemethod (e.g.,EplCoreModule.cs), ensure you register this new custom class instead of the default one:public override void PreInitialize() { // ... other configurations // Register your custom LDAPS compatible source Configuration.Modules.ZeroLdap().Enable(typeof(CustomLdapAuthenticationSource)); }Recommended way to test LDAPS only
Your proposed testing methodology is spot on. Here is our recommended approach to validate the setup:
- Disable Port 389 on a Dev DC: Yes, blocking port 389 via Windows Firewall on an isolated Development Domain Controller is the standard and most effective way to simulate the upcoming network environment.
- IIS Auth Isolation: If Windows Authentication is genuinely your only login method, the application will function normally because Kerberos operates independently of ABP's internal LDAP module. Testing this with port 389 blocked will give you 100% confidence.
- Monitor Event Viewer: On your Domain Controller, open the Event Viewer and look for Event ID 2889 (Directory Services). This event logs insecure (plaintext) LDAP binds. If your application attempts to use port 389, it will be logged here. You want to see zero 2889 events originating from your application server.
If you have any further questions or need additional assistance, please do not hesitate to reach out
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)