Skip to content

Active Directory Authentication does not work with Entitlements #127003

Description

@ldematte

Elasticsearch Version

8.18.0

Installed Plugins

No response

Java Version

bundled

OS Version

any

Problem Description

The active directory authenticator in x-pack-core uses the unboundid ldap SDK; this (pretty obvious, if you think about it) does a Socket.connect which requires outbound_network permission. This is missing from the x-pack-core policy, causing a NotEntitledException:

[WARN ][o.e.e.r.p.P.x.u.ldapsdk ] [name] Not entitled: component [x-pack-core], module [unboundid.ldapsdk], class [class com.unboundid.ldap.sdk.ConnectThread], entitlement [outbound_network]
org.elasticsearch.entitlement.runtime.api.NotEntitledException: component [x-pack-core], module [unboundid.ldapsdk], class [class com.unboundid.ldap.sdk.ConnectThread], entitlement [outbound_network]
at org.elasticsearch.entitlement.runtime.policy.PolicyManager.notEntitled(PolicyManager.java:572) ~[elasticsearch-entitlement-8.18.0.jar:?]
at org.elasticsearch.entitlement.runtime.policy.PolicyManager.checkFlagEntitlement(PolicyManager.java:514) ~[elasticsearch-entitlement-8.18.0.jar:?]
at org.elasticsearch.entitlement.runtime.policy.PolicyManager.checkEntitlementPresent(PolicyManager.java:604) ~[elasticsearch-entitlement-8.18.0.jar:?]
at org.elasticsearch.entitlement.runtime.policy.PolicyManager.checkOutboundNetworkAccess(PolicyManager.java:489) ~[elasticsearch-entitlement-8.18.0.jar:?]
at org.elasticsearch.entitlement.runtime.api.ElasticsearchEntitlementChecker.check$java_net_Socket$connect(ElasticsearchEntitlementChecker.java:636) ~[elasticsearch-entitlement-8.18.0.jar:?]
at java.net.Socket.connect(Socket.java) ~[?:?]
at com.unboundid.ldap.sdk.ConnectThread.run(ConnectThread.java:165) ~[?:?]
[2025-04-17T08:51:59,834][WARN ][o.e.x.s.a.RealmsAuthenticator] [name] Authentication to realm ad failed - authenticate failed (Caused by LDAPException(resultCode=91 (connect error)

Activity

  1. added
    needs:triageRequires assignment of a team area label
    and removed
    needs:triageRequires assignment of a team area label
    on Apr 17, 2025
  2. elasticsearchmachine commented on Apr 17, 2025

    @elasticsearchmachine
    Collaborator

    Pinging @elastic/es-core-infra (Team:Core/Infra)

  3. added a commit that references this issue on Apr 18, 2025
    b6c9584
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions