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

Allow Kibana client to authorize with Elasticsearch API key #27540

Merged
merged 7 commits into from
Aug 30, 2021

Conversation

michel-laterman
Copy link
Contributor

What does this PR do?

Allow the libbeat/kibana client to authorize using an API key instead of
a username/password. This setting can be specified under
output.elasticsearch.api_key in the same way that the username/password
can be.

Why is it important?

Allows the elasticsearch output settings (for authorization) to be used for Kibana setup.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] I have made corresponding change to the default configuration files
  • [] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  1. Create an API key in ES
  2. add the API key using the standard beat format (id:secret) in the beat.yml as output.elasticsearch.api_key setting
  3. run the beat setup kibana command

Related issues

Allow the libbeat/kibana client to authorize using an API key instead of
a username/password. This setting can be specified under
output.elasticsearch.api_key in the same way that the username/password
can be.
@michel-laterman michel-laterman added bug Team:Elastic-Agent Label for the Agent team v7.16.0 backport-v7.16.0 Automated backport with mergify labels Aug 20, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Aug 20, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 20, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-08-30T15:41:24.324+0000

  • Duration: 152 min 15 sec

  • Commit: 94bbde0

Test stats 🧪

Test Results
Failed 0
Passed 53721
Skipped 5325
Total 59046

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 53721
Skipped 5325
Total 59046

@ruflin
Copy link
Member

ruflin commented Aug 23, 2021

Can we add an automated test for this?

@mergify
Copy link
Contributor

mergify bot commented Aug 24, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b kibana-apikey upstream/kibana-apikey
git merge upstream/master
git push upstream kibana-apikey

@michel-laterman michel-laterman added the test-plan Add this PR to be manual test plan label Aug 24, 2021
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

libbeat/kibana/client.go Outdated Show resolved Hide resolved
Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
@michel-laterman
Copy link
Contributor Author

/test

@michel-laterman michel-laterman merged commit 0976134 into elastic:master Aug 30, 2021
@michel-laterman michel-laterman deleted the kibana-apikey branch August 30, 2021 21:03
mergify bot pushed a commit that referenced this pull request Aug 30, 2021
* Allow Kibana client to authorize with Elasticsearch API key

Allow the libbeat/kibana client to authorize using an API key instead of
a username/password. This setting can be specified under
output.elasticsearch.api_key in the same way that the username/password
can be.

* Add PR number to CHANGELOG

* Add testing

* Add license headers

* Update libbeat/kibana/client.go

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>

* gofmt

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
(cherry picked from commit 0976134)
michel-laterman added a commit that referenced this pull request Sep 1, 2021
…earch API key (#27654)

* Allow Kibana client to authorize with Elasticsearch API key (#27540)

* Allow Kibana client to authorize with Elasticsearch API key

Allow the libbeat/kibana client to authorize using an API key instead of
a username/password. This setting can be specified under
output.elasticsearch.api_key in the same way that the username/password
can be.

* Add PR number to CHANGELOG

* Add testing

* Add license headers

* Update libbeat/kibana/client.go

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>

* gofmt

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
(cherry picked from commit 0976134)

* Fix CHANGELOG

Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com>
Co-authored-by: michel-laterman <michel.laterman@elastic.co>
mdelapenya added a commit to mdelapenya/beats that referenced this pull request Sep 1, 2021
* master:
  Forward port 7.14.1 changelog to master  (elastic#27687)
  Addressing multiple dashboard issues: deps loading once, field conversion, etc. (elastic#27669)
  Remove adaptive queue sizes from agent's spec files (elastic#27653)
  Osquerybeat: Improve testability and unit test coverage (elastic#27591)
  Osquerybeat: lockdown flagsfile, prevent global defaults (elastic#27611)
  Import the references of dashboard assets using the Saved Objects API (elastic#27647)
  Fix bug with override path in cgroups (elastic#27620)
  Allow Kibana client to authorize with Elasticsearch API key (elastic#27540)
  Filebeat auditd: Fix Top Exec Commands dashboard visualization (elastic#27638)
  [elastic-agent] Fix docker tar.gz generation for complete image (elastic#27621)
  Follow up changes in dashboards in mage check && fix minor issue (elastic#27553)
  [Heartbeat] Fix bug where `enabled: false` is ignored. (elastic#27615)
  Support kube_state_metrics v2.0.0 (elastic#27552)
Icedroid pushed a commit to Icedroid/beats that referenced this pull request Nov 1, 2021
…27540)

* Allow Kibana client to authorize with Elasticsearch API key

Allow the libbeat/kibana client to authorize using an API key instead of
a username/password. This setting can be specified under
output.elasticsearch.api_key in the same way that the username/password
can be.

* Add PR number to CHANGELOG

* Add testing

* Add license headers

* Update libbeat/kibana/client.go

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>

* gofmt

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.16.0 Automated backport with mergify bug Team:Elastic-Agent Label for the Agent team test-plan Add this PR to be manual test plan v7.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kibana authentication is not inheriting the Elasticsearch output api_key value
4 participants