Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

basic auth not being enforced for config example #1008

Closed
ryandawsonuk opened this issue Jan 5, 2021 · 3 comments · Fixed by #1012
Closed

basic auth not being enforced for config example #1008

ryandawsonuk opened this issue Jan 5, 2021 · 3 comments · Fixed by #1012
Labels
bug Something isn't working elasticsearch

Comments

@ryandawsonuk
Copy link

Am following the config example to set basic auth. Have cloned the repo and am following it exactly except for this one change:

extraEnvs:
  - name: ELASTIC_PASSWORD
    valueFrom:
      secretKeyRef:
        name: elastic-config-credentials
        key: password
  - name: ELASTIC_USERNAME
    valueFrom:
      secretKeyRef:
        name: elastic-config-credentials
        key: username

Had to change this from the example which says elastic-credentials but it must mean elastic-config-credentials as that is the name of the secret. Otherwise I get Error: secret "elastic-credentials" not found.

With that change I can install everything.

The example curl of curl -u elastic:changeme http://localhost:9200/_cat/indices does indeed give a 200 response. But so does curl http://localhost:9200/_cat/indices. It doesn't force me to supply the user and password.

@jmlrt
Copy link
Member

jmlrt commented Jan 6, 2021

Hi @ryandawsonuk, thanks for reporting this => #1012 should fix it

@ryandawsonuk
Copy link
Author

@jmlrt that will get past the secret not found error and I made that change locally. But even with that change I get a 200 from curl http://localhost:9200/_cat/indices. If basic auth is being enforced then that should be unauthorized.

@ryandawsonuk ryandawsonuk changed the title basic auth not being enforced basic auth not being enforced for http Jan 6, 2021
@ryandawsonuk
Copy link
Author

ryandawsonuk commented Jan 6, 2021

@jmlrt found the problem, the missing ingredient is the xpack.security.enabled flag:

esConfig:
  elasticsearch.yml: |
    xpack.security.enabled: true
    path.data: /usr/share/elasticsearch/data

Realised this after trying the security example (which does work)

@ryandawsonuk ryandawsonuk changed the title basic auth not being enforced for http basic auth not being enforced for config example Jan 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working elasticsearch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants