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

HTTP-based metricbeat modules can no longer perform authentication #11351

Closed
ycombinator opened this issue Mar 20, 2019 · 7 comments
Closed

HTTP-based metricbeat modules can no longer perform authentication #11351

ycombinator opened this issue Mar 20, 2019 · 7 comments

Comments

@ycombinator
Copy link
Contributor

  • Version: master / 8.0.0
  • Operating System: Mac OS X
  • Steps to Reproduce:
    1. Setup Elasticsearch with Trial license, Security enabled, and elastic user to have password as abc123.
    2. Enable Elasticsearch metricbeat module.
      ./metricbeat modules enable elasticsearch
      
    3. Uncomment and set username and password settings in the Elasticsearch metricbeat module configuration.
      username: elastic
      password: abc123
      
    4. Start Metricbeat.
      ./metricbeat -e
      

You will see a 401 Unauthorized error in the logs.

Looking at Wireshark, it looks like Metricbeat does not add the Authorization header, as one would expect it to with the above configuration:

Screen Shot 2019-03-20 at 12 43 02 PM

I did a similar test with the Kibana Metricbeat module and ended up with the same results: 401 error in the logs and Wireshark showing no Authorization header.

@ycombinator
Copy link
Contributor Author

ycombinator commented Mar 20, 2019

Just tested with Metricbeat 6.7.0 (built from the 6.7 branch) and this was working as expected.

@ycombinator
Copy link
Contributor Author

ycombinator commented Mar 20, 2019

Just tested with Metricbeat 7.0.0 (built from the 7.0 branch) and this is working as expected.

@ycombinator
Copy link
Contributor Author

Just tested with Metricbeat 7.1.0 (built from the 7.x branch) and this is working as expected.

@ycombinator
Copy link
Contributor Author

Based on the above versions' testing, it appears that this regression was introduced in master / 8.0.0 recently, that is between the last time master was backported to 7.x and now.

@ruflin @jsoriano can you think of any recent PRs to master that might've introduced this regression?

@ycombinator
Copy link
Contributor Author

@jsoriano @ruflin I did some git bisect testing and I think #11032 might've caused this regression. Would one of you mind confirming?

@ycombinator ycombinator changed the title HTTP metricbeat modules can no longer perform authentication HTTP-based metricbeat modules can no longer perform authentication Mar 20, 2019
@jsoriano
Copy link
Member

I'd also bet this regresion is introduced by #11032, investigating it.

@ycombinator could you try to reproduce this issue with 6.7.0 but setting a timeout? So the config is something like:

username: elastic
password: abc123
timeout: 2s

@jsoriano
Copy link
Member

@ycombinator PR open to fix this #11353, good catch!

jsoriano added a commit to jsoriano/beats that referenced this issue Mar 20, 2019
After the refactor done in elastic#11032, baseData was not being passed to the
HTTP helper, so authentication was not working.

Added a test to avoid regressions here.

Fix elastic#11351
jsoriano added a commit that referenced this issue Mar 21, 2019
After the refactor done in #11032, baseData was not being passed to the
HTTP helper, so authentication was not working.

Added a test to avoid regressions here.

Fix #11351
jsoriano added a commit to jsoriano/beats that referenced this issue Mar 21, 2019
After the refactor done in elastic#11032, baseData was not being passed to the
HTTP helper, so authentication was not working.

Added a test to avoid regressions here.

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

No branches or pull requests

2 participants