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

Additional validation for elasticsearch username #48247

Merged

Conversation

jportner
Copy link
Contributor

@jportner jportner commented Oct 15, 2019

Summary

If "elastic" user is set in config:

  • In dev mode, throws an error
  • In prod mode, logs a deprecation warning

Resolves: #45973

"Release Note: Deprecated the use of the 'elastic' superuser for Kibana."

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@jportner jportner added release_note:deprecation Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v7.5.0 v8.0.0 labels Oct 15, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@@ -160,7 +177,7 @@ export class ElasticsearchConfig {
*/
public readonly customHeaders: ElasticsearchConfigType['customHeaders'];

constructor(rawConfig: ElasticsearchConfigType) {
constructor(rawConfig: ElasticsearchConfigType, log?: Logger) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since passing the logger to this constructor is temporary (shouldn't be needed when #40255 is resolved), I left the param as optional -- to avoid TypeScript errors in test files and to avoid changing those files.

@jportner
Copy link
Contributor Author

Note: as discussed with @legrego, this change also affects OSS users -- even though OSS has no concept of the "superuser" (paraphrasing here). We couldn't think of any way to add this validation without any impact to OSS users though.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@jportner
Copy link
Contributor Author

Spoke to @azasypkin and @jkakavas about this--
The last functional test for SAML IdP-initiated single-logout is failing due to a bug in ElasticSearch (elastic/elasticsearch#47151).
This was not surfacing in Kibana tests before because the tests were running with the "elastic" superuser.

@jportner
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💔 Build Failed

@jportner jportner force-pushed the issue-45973-prohibit-kibana-superuser branch from fa84842 to 947ac8b Compare November 1, 2019 21:12
@elasticmachine
Copy link
Contributor

💔 Build Failed

@jportner jportner force-pushed the issue-45973-prohibit-kibana-superuser branch from 947ac8b to 9dc0949 Compare November 13, 2019 20:56
@elasticmachine
Copy link
Contributor

💔 Build Failed

@jportner jportner force-pushed the issue-45973-prohibit-kibana-superuser branch from 9dc0949 to 58d3358 Compare November 14, 2019 00:36
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@jportner jportner marked this pull request as ready for review November 14, 2019 15:35
@jportner jportner requested a review from a team as a code owner November 14, 2019 15:35
@jportner jportner requested a review from a team November 14, 2019 15:36
@kobelb kobelb self-requested a review November 14, 2019 15:40
@kobelb
Copy link
Contributor

kobelb commented Nov 14, 2019

This is awesome, nicework! Just one nit, and a question/suggestion.

@jportner jportner force-pushed the issue-45973-prohibit-kibana-superuser branch from 58d3358 to 1664a13 Compare November 15, 2019 15:12
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@jportner jportner added v7.6.0 and removed v7.5.0 labels Nov 15, 2019
If "elastic" user is set in config:
* In dev mode, throws an error
* In prod mode, logs a deprecation warning
Revert "Fix user for functional tests" and
"Fix user for plugin functional tests in Jenkinsfile"
Now uses "kibana" user instead of "elastic" user
@jportner jportner force-pushed the issue-45973-prohibit-kibana-superuser branch from 1664a13 to c6daad1 Compare November 18, 2019 13:58
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@jportner jportner merged commit bde2895 into elastic:master Nov 18, 2019
jportner added a commit to jportner/kibana that referenced this pull request Nov 18, 2019
* Additional validation for elasticsearch username

If "elastic" user is set in config:
* In dev mode, throws an error
* In prod mode, logs a deprecation warning

* Fix user for functional tests

* Revert last two commits

Revert "Fix user for functional tests" and
"Fix user for plugin functional tests in Jenkinsfile"

* Change elasticsearch creds for test server

Now uses "kibana" user instead of "elastic" user

* Fix plugin API functional tests

* Fix PKI API integration test

* Change log messages, now conditional on `dist: false` not `dev: true`
jportner added a commit that referenced this pull request Nov 18, 2019
* Additional validation for elasticsearch username

If "elastic" user is set in config:
* In dev mode, throws an error
* In prod mode, logs a deprecation warning

* Fix user for functional tests

* Revert last two commits

Revert "Fix user for functional tests" and
"Fix user for plugin functional tests in Jenkinsfile"

* Change elasticsearch creds for test server

Now uses "kibana" user instead of "elastic" user

* Fix plugin API functional tests

* Fix PKI API integration test

* Change log messages, now conditional on `dist: false` not `dev: true`
@jportner jportner deleted the issue-45973-prohibit-kibana-superuser branch November 18, 2019 16:51
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 18, 2019
…-fallback

* 'master' of github.com:elastic/kibana: (116 commits)
  [Maps] move apply global filter settting from layer to source (elastic#50523)
  [SIEM] Fix: Empty `Source` / `Destination` shown when only ports are populated (elastic#50843)
  [Maps] Delay vector tile layer syncing until spritesheet is loaded (elastic#48955)
  [Maps] prevent users from overflowing URL when filtering by shape (elastic#50747)
  [DOCS] Mark Beats central management as discontinued (elastic#49423)
  [page_objects/common_page] convert to ts (elastic#50771)
  [NP Kibana Migrations ] kibana plugin home (elastic#50444)
  [DOCS] Shareables naming convention (elastic#50497)
  [ML] DF Analytics - auto-populate model_memory_limit (elastic#50714)
  Increase alerting test stability and reduce flakiness (elastic#50246)
  [ML] Remaning new_job_new folder (elastic#50917)
  [Telemetry] Show opt-in changes for OSS users (elastic#50831)
  [ML] Fix lat_long anomalies table links menu and value formatting (elastic#50916)
  [Dev] Fix serialising a really big string (elastic#50915)
  Better explanation about the Prettier recommendation (extension vs. NPM module) (elastic#50629)
  [Monitoring] Use a basic monitoring user for tests (elastic#47865)
  [Monitoring] Gracefully handle issue with filebeat indices (elastic#48929)
  [Monitoring] Improve permissions required around setup mode (elastic#50421)
  Additional validation for elasticsearch username (elastic#48247)
  Revert changes to use_kibana_ui_setting (elastic#50877)
  ...

# Conflicts:
#	src/legacy/core_plugins/console/server/request.test.ts
This was referenced Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:deprecation Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block developers from running Kibana as superuser
5 participants