Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples for the proxy_auth rule? #193

Closed
parosio opened this issue Mar 14, 2017 · 19 comments
Closed

Examples for the proxy_auth rule? #193

parosio opened this issue Mar 14, 2017 · 19 comments

Comments

@parosio
Copy link

parosio commented Mar 14, 2017

Hello,
I'm trying to configure readonlyrest 1.14.0 (elastic 5.2) to use the authentication provided by nginx.

With the following configuration I get a simple role-based behavior: both admin and user are authenticated by Nginx and have the correct authorization (r/w for admin, ro for user)

I'm unclear about how to use the proxy_auth rule to avoid the need to specify the auth_key for each user.

The nginx config is simply:

  upstream kibana {
    server elkserver:5601;
    keepalive 5;
  }
 ...
   location / {
    proxy_pass http://kibana;
    proxy_set_header Connection "Keep-Alive";
    proxy_set_header Proxy-Connection "Keep-Alive";
      auth_basic "Nginx proxy for Kibana";
      auth_basic_user_file ./.htpasswd;
      proxy_set_header X-Forwarded-User $remote_user;
   }

In elasticsearch.yml, besides the acl for logstash and kibana:

    - name: "::LOGSTASH::"
      auth_key: logstash:**************
      type: allow
      actions: ["indices:admin/types/exists","indices:data/read/*","indices:data/write/*","indices:admin/template/*","indices:admin/create"]
      indices: ["logstash-*",]
    - name: "::KIBANA-SRV::"
      auth_key: kibana:************
      type: allow

I've defined two "groups" and the users belonging to them:

 access_control_rules:
   [ ... ]
    #
    # Groups definition for real users
    #
    - name: HQ Admins
      type: allow
      kibana_access: rw
      groups: ["HQ_Admin"]
      indices: ["logstash-*", ".kibana", ".kibana-devnull"]

    - name: HQ ReadOnly
      type: allow
      kibana_access: ro
      groups: ["HQ_Ro"]
      indices: ["logstash-*", ".kibana", ".kibana-devnull"]

    users:
    - username: admin
      auth_key: admin:************  ## <==== without this, elastic does not start
      groups: ["HQ_Admin"]

    - username: user
      auth_key: user::************   ## <==== without this, elastic does not start
      groups: ["HQ_Ro"]

I would get rid of the auth_key property, but cannot figure out how to.

@parosio
Copy link
Author

parosio commented Mar 14, 2017

Sorry,
just found the Delegate authentication to reverse proxy pull request

@sscarduzio
Copy link
Owner

Hi @parosio!
Yep I didn't document the proxy auth yet, I went to do it and got caught into fixing the documentation websites anchors (btw they now work).

Your GH issue comes in handy: I can reuse your snippets 👍
Glad you figured out!

@sscarduzio
Copy link
Owner

@parosio what type of authentication are you implementing in Nginx?

@parosio
Copy link
Author

parosio commented Mar 14, 2017

Hi @sscarduzio! thank you for your reply.

Currently, Nginx use basic authentication against a local htpasswd file.

Btw, I've tried the following:

    - name: HQ Admins
      type: allow
      kibana_access: rw
        proxy_auth: ["admin"]
      groups: ["HQ_Admin"]
      indices: ["logstash-*", ".kibana", ".kibana-devnull"]

but the elastic bootstrap complains:

nested: ScannerException[mapping values are not allowed here
 in 'reader', line 137, column 19:
            proxy_auth: ["admin"]
                      ^
];
Likely root cause: mapping values are not allowed here

Using the proxy_auth rule in the user definition, on the other side, seems not working: from nginx access.log: 10.130.210.17 - admin [14/Mar/2017:14:19:35 +0100] "GET /app/kibana HTTP/1.1" 401 109 "http://nagiossrv:8080/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

   users:
   - username: admin
     # auth_key: admin:*****************
     proxy_auth: ["admin"]
     groups: ["HQ_Admin"]

@sscarduzio
Copy link
Owner

the above is a YAML formatting error, un-indent the proxy_auth rule so it is inline with kibana_access

@parosio
Copy link
Author

parosio commented Mar 14, 2017

Thanks.
Nevertheless, the only way (by now) I succeded to have it working is with the following configuration:

    access_control_rules:
  [ ... ]
    - name: HQ ReadOnly
      type: allow
      kibana_access: ro
      groups: ["HQ_Ro"]
      indices: ["logstash-*", ".kibana", ".kibana-devnull"]
 [ ... ]
 users:
    - username: user
      auth_key: user:same password as nginx
      groups: ["HQ_Ro"]

Nginx asks for credentials, then I have access to Kibana.
If I don't set auth_key in the users: section (and with the same password set in nginx htpasswd file) I am repeatedly asked for credentials.

I'm definetely missing something

Below the first three (successful) request logs with the cfg above:

[2017-03-14T15:57:44,387][INFO ][o.e.p.r.a.ACL            ] request: { ID:019e22d7944a4c72a7d7fbe7551e58e8, TYP:GetRequest, USR:user, BRS:false, ACT:indices:data/read/get, OA:127.0.0.1, IDX:.kibana, MET:GET, PTH:/.kibana/config/5.2.0, CNT:<OMITTED, LENGTH=0>, HDR:authorization,Connection,Host,Content-Length, EFF:0, HIS:[HQ ReadOnly->[]], [::LOGSTASH::->[indices->false, auth_key->false, actions->true]], [::KIBANA-SRV::->[auth_key->false]], [::RO DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [HQ Admins->[kibana_access->true, indices->true, groups->false]], [::RW DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [HQ ReadOnly->[kibana_access->true, indices->true, groups->true]] } matched block: HQ ReadOnly match: true}
[2017-03-14T15:57:46,596][INFO ][o.e.p.r.a.ACL            ] request: { ID:f33be62a48404f0ba250fe5822f98824, TYP:SearchRequest, USR:user, BRS:false, ACT:indices:data/read/search, OA:127.0.0.1, IDX:.kibana, MET:POST, PTH:/.kibana/index-pattern/_search, CNT:<OMITTED, LENGTH=39>, HDR:authorization,content-length,x-forwarded-proto,Connection,x-forwarded-port,content-type,Host,x-forwarded-for, EFF:0, HIS:[::KIBANA-SRV::->[auth_key->false]], [HQ ReadOnly->[kibana_access->true, indices->true, groups->true]], [::RW DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [::RO DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [HQ ReadOnly->[]], [::LOGSTASH::->[indices->false, auth_key->false, actions->true]], [HQ Admins->[kibana_access->true, indices->true, groups->false]] } matched block: HQ ReadOnly match: true}
[2017-03-14T15:57:46,842][INFO ][o.e.p.r.a.ACL            ] request: { ID:7b6f0f3bc2e04bb086193899a2408c3b, TYP:GetFieldMappingsRequest, USR:user, BRS:false, ACT:indices:admin/mappings/fields/get, OA:127.0.0.1, IDX:.kibana, MET:GET, PTH:/.kibana/_mapping/*/field/_source, CNT:<OMITTED, LENGTH=0>, HDR:authorization,content-length,x-forwarded-proto,Connection,x-forwarded-port,Host,x-forwarded-for, EFF:0, HIS:[HQ ReadOnly->[kibana_access->true, indices->true, groups->true]], [HQ ReadOnly->[]], [::RO DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [HQ Admins->[kibana_access->true, indices->true, groups->false]], [::LOGSTASH::->[indices->false, auth_key->false, actions->false]], [::KIBANA-SRV::->[auth_key->false]], [::RW DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]] } matched block: HQ ReadOnly match: true}

@parosio
Copy link
Author

parosio commented Mar 14, 2017

With this configuration:

    - username: user
      auth_key: user:A Password Different from Nginx's
      # proxy_auth: ["*"]
      groups: ["HQ_Ro"]

I get a no-match and a forbidden result:

[2017-03-14T16:17:17,209][INFO ][o.e.p.r.a.ACL            ]  no block has matched, forbidding by default: { ID:2dcd6c16456f4d029f7864fbe1b0596b, TYP:GetRequest, USR:user, BRS:false, ACT:indices:data/read/get, OA:127.0.0.1, IDX:.kibana, MET:GET, PTH:/.kibana/config/5.2.0, CNT:<OMITTED, LENGTH=0>, HDR:authorization,Connection,Host,Content-Length, EFF:0, HIS:[HQ ReadOnly->[kibana_access->true, indices->true, groups->false]], [HQ Admins->[kibana_access->true, indices->true, groups->false]], [::RO DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [::LOGSTASH::->[indices->false, auth_key->false, actions->true]], [::RW DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [::KIBANA-SRV::->[auth_key->false]] }
[2017-03-14T16:17:17,210][INFO ][o.e.p.r.IndexLevelActionFilter] [ZptFGTK] forbidden request: { ID:2dcd6c16456f4d029f7864fbe1b0596b, TYP:GetRequest, USR:user, BRS:false, ACT:indices:data/read/get, OA:127.0.0.1, IDX:.kibana, MET:GET, PTH:/.kibana/config/5.2.0, CNT:<OMITTED, LENGTH=0>, HDR:authorization,Connection,Host,Content-Length, EFF:0, HIS:[HQ ReadOnly->[kibana_access->true, indices->true, groups->false]], [HQ Admins->[kibana_access->true, indices->true, groups->false]], [::RO DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [::LOGSTASH::->[indices->false, auth_key->false, actions->true]], [::RW DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [::KIBANA-SRV::->[auth_key->false]] } Reason: null (null)

@sscarduzio
Copy link
Owner

Proxy auth should work configuring ReadonlyREST like this:

   [...]
    - name: "::LOGSTASH::"
      auth_key: logstash:**************
      type: allow
      actions: ["indices:admin/types/exists","indices:data/read/*","indices:data/write/*","indices:admin/template/*","indices:admin/create"]
      indices: ["logstash-*"]

    - name: "::KIBANA-SRV::"
      auth_key: kibana:************
      type: allow

    - name: HQ ReadOnly
      type: allow
      kibana_access: ro
      proxy_auth: "*" # or even ["user"] to restrict access to that one user.
      indices: ["logstash-*", ".kibana", ".kibana-devnull"]

ReadonlyREST does not need to know the password of "user", as authentication is delegated to nginx.

Should this be not working, there's a bug. In which case, don't forget to name your ES version! :)

@parosio
Copy link
Author

parosio commented Mar 15, 2017

Hi @sscarduzio, It seems my case.

The readonlyrest version is 1.14; elasticsearch 5.2.0.

With the elasticsearch.yml you suggested:

    access_control_rules:
    [ . . . ]
    - name: HQ Admins
      type: allow
      kibana_access: rw
      proxy_auth: "admin"
      indices: ["logstash-*", ".kibana", ".kibana-devnull"]

    - name: HQ ReadOnly
      type: allow
      kibana_access: ro
      proxy_auth: "*"
      indices: ["logstash-*", ".kibana", ".kibana-devnull"]

stopped and restarted elastic.

I've got the following results:

nginx access.log: client: chrome 56

10.130.210.17 - - [15/Mar/2017:09:19:11 +0100] "GET / HTTP/1.1" 401 597 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
10.130.210.17 - user [15/Mar/2017:09:19:26 +0100] "GET / HTTP/1.1" 200 156 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
10.130.210.17 - user [15/Mar/2017:09:19:26 +0100] "GET /app/kibana HTTP/1.1" 401 109 "http://nagiossrv:8080/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"

Elasticsearch log:

[2017-03-15T09:19:26,630][INFO ][o.e.p.r.a.ACL            ]  no block has matched, forbidding by default: { ID:1e7ebaa62a664b6780fddf528f05543b, TYP:GetRequest, USR:user, BRS:false, ACT:indices:data/read/get, OA:127.0.0.1, IDX:.kibana, MET:GET, PTH:/.kibana/config/5.2.0, CNT:<OMITTED, LENGTH=0>, HDR:authorization,Connection,Host,Content-Length, EFF:0, HIS:[::KIBANA-SRV::->[auth_key->false]], [::RO DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [HQ ReadOnly->[kibana_access->true, indices->true, proxy_auth->false]], [HQ Admins->[kibana_access->true, indices->true, proxy_auth->false]], [::LOGSTASH::->[indices->false, auth_key->false, actions->true]], [::RW DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]] }
[2017-03-15T09:19:26,630][INFO ][o.e.p.r.IndexLevelActionFilter] [ZptFGTK] forbidden request: { ID:1e7ebaa62a664b6780fddf528f05543b, TYP:GetRequest, USR:user, BRS:false, ACT:indices:data/read/get, OA:127.0.0.1, IDX:.kibana, MET:GET, PTH:/.kibana/config/5.2.0, CNT:<OMITTED, LENGTH=0>, HDR:authorization,Connection,Host,Content-Length, EFF:0, HIS:[::KIBANA-SRV::->[auth_key->false]], [::RO DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [HQ ReadOnly->[kibana_access->true, indices->true, proxy_auth->false]], [HQ Admins->[kibana_access->true, indices->true, proxy_auth->false]], [::LOGSTASH::->[indices->false, auth_key->false, actions->true]], [::RW DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]] } Reason: null (null)

Same (negative) results using Firefox:

10.130.210.17 - - [15/Mar/2017:09:25:15 +0100] "GET / HTTP/1.1" 401 195 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"
10.130.210.17 - admin [15/Mar/2017:09:25:31 +0100] "GET / HTTP/1.1" 200 156 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"
10.130.210.17 - admin [15/Mar/2017:09:25:31 +0100] "GET /app/kibana HTTP/1.1" 401 109 "http://nagiossrv:8080/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

Elastic:

[2017-03-15T09:25:31,825][INFO ][o.e.p.r.a.ACL            ]  no block has matched, forbidding by default: { ID:25383624d8c842f49fcb8cf1f43616a7, TYP:GetRequest, USR:admin, BRS:false, ACT:indices:data/read/get, OA:127.0.0.1, IDX:.kibana, MET:GET, PTH:/.kibana/config/5.2.0, CNT:<OMITTED, LENGTH=0>, HDR:authorization,Connection,Host,Content-Length, EFF:0, HIS:[HQ ReadOnly->[kibana_access->true, indices->true, proxy_auth->false]], [::LOGSTASH::->[indices->false, auth_key->false, actions->true]], [::RW DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [::KIBANA-SRV::->[auth_key->false]], [::RO DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [HQ Admins->[kibana_access->true, indices->true, proxy_auth->false]] }
[2017-03-15T09:25:31,826][INFO ][o.e.p.r.IndexLevelActionFilter] [ZptFGTK] forbidden request: { ID:25383624d8c842f49fcb8cf1f43616a7, TYP:GetRequest, USR:admin, BRS:false, ACT:indices:data/read/get, OA:127.0.0.1, IDX:.kibana, MET:GET, PTH:/.kibana/config/5.2.0, CNT:<OMITTED, LENGTH=0>, HDR:authorization,Connection,Host,Content-Length, EFF:0, HIS:[HQ ReadOnly->[kibana_access->true, indices->true, proxy_auth->false]], [::LOGSTASH::->[indices->false, auth_key->false, actions->true]], [::RW DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [::KIBANA-SRV::->[auth_key->false]], [::RO DEVELOPER::->[kibana_access->true, indices->true, auth_key->false]], [HQ Admins->[kibana_access->true, indices->true, proxy_auth->false]] } Reason: null (null)

The same with curl: I'm authenticated by nginx, but

[elk@localhost elk]$ curl -u user 'localhost:8080' -v
Enter host password for user 'user':
* About to connect() to localhost port 8080
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080
* Server auth using Basic with user 'user'
> GET / HTTP/1.1
> Authorization: Basic dXNlcjp1c2Vy
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: localhost:8080
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: nginx/1.10.1
< Date: Wed, 15 Mar 2017 08:39:03 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 217
< Connection: keep-alive
< kbn-name: kibana
< kbn-version: 5.2.0
< cache-control: no-cache
< accept-ranges: bytes
<script>var hashRoute = '/app/kibana';
var defaultRoute = '/app/kibana';

var hash = window.location.hash;
if (hash.length) {
  window.location = hashRoute + hash;
} else {
  window.location = defaultRoute;
Connection #0 to host localhost left intact
* Closing connection #0
}</script>
[elk@localhost elk]$ curl -u user 'localhost:8080/app/kibana' -v
Enter host password for user 'user':
* About to connect() to localhost port 8080
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080
* Server auth using Basic with user 'user'
> GET /app/kibana HTTP/1.1
> Authorization: Basic dXNlcjp1c2Vy
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: localhost:8080
> Accept: */*
> 
< HTTP/1.1 401 Unauthorized
< Server: nginx/1.10.1
< Date: Wed, 15 Mar 2017 08:39:22 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 78
< Connection: keep-alive
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="Authorization Required"
< kbn-name: kibana
< kbn-version: 5.2.0
< cache-control: no-cache
Connection #0 to host localhost left intact
* Closing connection #0
{"statusCode":401,"error":"Unauthorized","message":"Authentication Exception"}
[elk@localhost elk]$ 

@parosio parosio closed this as completed Mar 15, 2017
@parosio parosio reopened this Mar 15, 2017
@sscarduzio
Copy link
Owner

OK very well, will try to reproduce. Thanks @parosio.

@sscarduzio
Copy link
Owner

sscarduzio commented Mar 15, 2017

In your logs the request coming to ES has no x-forwarded-user header, it still carries the authorization header though. Are you sure the header is being written by nginx?

See in the logs the HDR field where the header names found in the request are listed.

[2017-03-15T09:19:26,630][INFO ] (...) HDR:authorization,Connection,Host,Content-Length, (...)

@parosio
Copy link
Author

parosio commented Mar 15, 2017

Apparently yes.
From the kibana.log

elk@localhost log]$ grep '2017-03-15T08:19'  kibana.log 
{"type":"response","@timestamp":"2017-03-15T08:19:26Z","tags":[],"pid":7912,"method":"get","statusCode":200,"req":{"url":"/","method":"get","headers":{"connection":"Keep-Alive","proxy-connection":"Keep-Alive","x-forwarded-user":"user","host":"kibana","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8","accept-encoding":"gzip, deflate, sdch","accept-language":"it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4"},"remoteAddress":"10.107.134.246","userAgent":"10.107.134.246"},"res":{"statusCode":200,"responseTime":6,"contentLength":9},"message":"GET / 200 6ms - 9.0B"}
{"type":"response","@timestamp":"2017-03-15T08:19:26Z","tags":[],"pid":7912,"method":"get","statusCode":401,"req":{"url":"/app/kibana","method":"get","headers":{"connection":"Keep-Alive","proxy-connection":"Keep-Alive","x-forwarded-user":"user","host":"kibana","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8","referer":"http://nagiossrv:8080/","accept-encoding":"gzip, deflate, sdch","accept-language":"it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4"},"remoteAddress":"10.107.134.246","userAgent":"10.107.134.246","referer":"http://nagiossrv:8080/"},"res":{"statusCode":401,"responseTime":18,"contentLength":9},"message":"GET /app/kibana 401 18ms - 9.0B"}

both requests have the x-forwarded-user header

@sscarduzio
Copy link
Owner

So basically Kibana is not forwarding X-Forwarded-User header? @innotech-research how can this work for you?

@innotech-research
Copy link
Contributor

innotech-research commented Mar 15, 2017 via email

@sscarduzio
Copy link
Owner

I'm going to try and make this work without Kibana plugin. Hacking my way through crap as usual. Will update.

@sscarduzio
Copy link
Owner

I found you can configure Kibana with a white list of headers to pass through to Elasticsearch. By default, only the Authorization header is passed.

elasticsearch.requestHeadersWhitelist:
Default: [ 'authorization' ] List of Kibana client-side headers to send to Elasticsearch. To send no client-side headers, set this value to [] (an empty list).

https://github.com/elastic/kibana/blob/a8989cc2ee3134433c0bea50aa1938735c383d68/docs/setup/settings.asciidoc

@parosio
Copy link
Author

parosio commented Mar 16, 2017

Hi @sscarduzio, thank you very much for this hint.
Changing the value of requestHeadersWhitelist to x-forwarded-user, together with the proxy-auth value in the acl, we have the correct access level to elastic.

One more question: which is the relation between the users: and the access_control_rules: sections?
we'd need to specify a few groups (modeled over the ACL) and have some users belonging to one or more of them.

@parosio
Copy link
Author

parosio commented Mar 17, 2017

As far as we understand, we have these possibilities (not mutually exclusive):

  • specify a list of userIDs in the proxy_auth property of the ACL (admins in example below)
  • specify a list of userIDs in the proxy_auth property of a user
   access_control_rules:
      [ ...]
   - name: HQ Admins
      type: allow
      kibana_access: rw
      groups: ["HQ_Admin"]
      proxy_auth: ["admin","KateAdm","JohnAdm"]
      indices: ["logstash-*", ".kibana", ".kibana-devnull"]

    - name: HQ ReadOnly
      type: allow
      kibana_access: ro
      groups: ["HQ_Ro"]
      # proxy_auth: []   <====== users specified in users: section
      indices: ["logstash-*", ".kibana", ".kibana-devnull"]

    users:
    - username: admin
      proxy_auth: ["admin"]         # <===== duplicate of the above "HQ Admins" ACL
      groups: ["HQ_Admin"]

    - username: user
      proxy_auth: ["user", "Kate", "John", "Bob"]  
      groups: ["HQ_Ro"]

Bob is a ReadOnly user. Other users authenticated by Nginx but not authorized are repeatedly asked for a valid authentication.

@sscarduzio
Copy link
Owner

The semantic of proxy_auth overlaps quite a bit with the groups feature. I suggest to keep it simple and avoid groups for your use case, and stick with listing user names inside the proxy_auth rule.

PS: We definitely could do better on the UX of the rules in the future. I.e. less rules, more powerful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants