# Deny LDAP users without role mapping

**URL:** <https://discuss.elastic.co/t/deny-ldap-users-without-role-mapping/142898>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [August 3, 2018, 11:40am UTC](https://discuss.elastic.co/t/deny-ldap-users-without-role-mapping/142898 "2018-08-03T11:40:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![programagor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/programagor/32/40183_2.png) [@programagor](https://discuss.elastic.co/u/programagor)\
**Post date:** [August 3, 2018, 11:40am UTC](https://discuss.elastic.co/t/deny-ldap-users-without-role-mapping/142898/1 "2018-08-03T11:40:48Z")

</div>

Greetings

I have some of my nodes set up to accept users via LDAP authentication, with role mapping based on group membership. The relevant configuration looks like this.

elasticsearch.yml:

```
xpack.security.authc.realms:
    realm1:
        type: native
        order: 0
    realm2:
        type: ldap
        order: 1
        metadata: uid
        url: ["ldaps://bizldap40:646","ldaps://bizldap41:636"]
        ssl.certificate_authorities: /etc/elasticsearch/certs/ldapcacert.crt
        user_search:
            base_dn: "ou=people,dc=example,dc=biz"
            attribute: uid
        group_search:
            base_dn: "ou=clog_mail,ou=mailcloud,ou=svcs,dc=example,dc=biz"
            scope: sub_tree
            user_attribute: uid
            filter: "(&(objectClass=posixGroup)(member=uid={0},ou=people,dc=example,dc=biz))"

```

Role mapping:

```
{
  "admins": {
    "enabled": true,
    "roles": [
      "superuser"
    ],
    "rules": {
      "field": {
        "groups": "cn=CLOG-ELK-Admin,ou=clog_mail,ou=mailcloud,ou=svcs,dc=example,dc=biz"
      }
    }
  },
  "viewers": {
    "enabled": true,
    "roles": [
      "kibana_dashboard_only_user"
    ],
    "rules": {
      "field": {
        "groups": "cn=CLOG-ELK-Viewer,ou=clog_mail,ou=mailcloud,ou=svcs,dc=example,dc=biz"
      }
    }
  },
  "editors": {
    "enabled": true,
    "roles": [
      "editor_user"
    ],
    "rules": {
      "field": {
        "groups": "cn=CLOG-ELK-Editor,ou=clog_mail,ou=mailcloud,ou=svcs,dc=example,dc=biz"
      }
    }
  }
}

```

Now, when a user without membership in either `CLOG-ELK-Admin`, `CLOG-ELK-Editor`, or `CLOG-ELK-Viewer` tries to log in through Kibana, they are admitted into the Kibana GUI, but not granted any rights.  
Is there a way to deny the login attempt entirely for such users?

Thanks

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [August 3, 2018, 12:36pm UTC](https://discuss.elastic.co/t/deny-ldap-users-without-role-mapping/142898/2 "2018-08-03T12:36:10Z")

</div>

No, this is not possible in current versions. There is an [open issue](https://github.com/elastic/kibana/issues/18270) to change this.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 31, 2018, 12:36pm UTC](https://discuss.elastic.co/t/deny-ldap-users-without-role-mapping/142898/3 "2018-08-31T12:36:24Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
