From 7ba2defdbfa5f762d1905e85ec71dd44ed7c0c9d Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 11 Apr 2018 11:21:15 -0400 Subject: [PATCH] Rename setup-passwords This commit renames setup-passwords to elasticsearch-setup-passwords. --- .../docs/en/commands/setup-passwords.asciidoc | 18 +++++++++--------- .../docs/en/security/authentication.asciidoc | 18 +++++++++--------- .../docs/en/security/configuring-es.asciidoc | 15 ++++++++------- .../configuring-tls-docker.asciidoc | 6 +++--- .../docs/en/security/troubleshooting.asciidoc | 18 +++++++++--------- x-pack/docs/en/setup/xpack-passwords.asciidoc | 15 ++++++++------- ...passwords => elasticsearch-setup-passwords} | 0 ...s.bat => elasticsearch-setup-passwords.bat} | 0 .../authc/esnative/tool/SetupPasswordTool.java | 3 ++- .../packaging/tests/bootstrap_password.bash | 6 +++--- .../resources/packaging/tests/certgen.bash | 9 +++++---- .../packaging/tests/setup_passwords.bash | 7 ++++--- .../test/resources/packaging/utils/xpack.bash | 4 ++-- 13 files changed, 62 insertions(+), 57 deletions(-) rename x-pack/plugin/security/src/main/bin/{setup-passwords => elasticsearch-setup-passwords} (100%) rename x-pack/plugin/security/src/main/bin/{setup-passwords.bat => elasticsearch-setup-passwords.bat} (100%) diff --git a/x-pack/docs/en/commands/setup-passwords.asciidoc b/x-pack/docs/en/commands/setup-passwords.asciidoc index a0f6281638d..42f3c824496 100644 --- a/x-pack/docs/en/commands/setup-passwords.asciidoc +++ b/x-pack/docs/en/commands/setup-passwords.asciidoc @@ -1,16 +1,16 @@ [role="xpack"] [[setup-passwords]] -== setup-passwords +== elasticsearch-setup-passwords -The `setup-passwords` command sets the passwords for the built-in `elastic`, -`kibana`, `logstash_system`, and `beats_system` users. +The `elasticsearch-setup-passwords` command sets the passwords for the built-in +`elastic`, `kibana`, `logstash_system`, and `beats_system` users. [float] === Synopsis [source,shell] -------------------------------------------------- -bin/x-pack/setup-passwords auto|interactive +bin/elasticsearch-setup-passwords auto|interactive [-b, --batch] [-h, --help] [-E ] [-s, --silent] [-u, --url ""] [-v, --verbose] -------------------------------------------------- @@ -32,10 +32,10 @@ automatically attempts to establish the connection by using the HTTPS protocol. It configures the connection by using the `xpack.security.http.ssl` settings in the `elasticsearch.yml` file. If you do not use the default config directory location, ensure that the *ES_PATH_CONF* environment variable returns the -correct path before you run the `setup-passwords` command. You can override -settings in your `elasticsearch.yml` file by using the `-E` command option. -For more information about debugging connection failures, see -{xpack-ref}/trb-security-setup.html[Setup-passwords command fails due to connection failure]. +correct path before you run the `elasticsearch-setup-passwords` command. You can +override settings in your `elasticsearch.yml` file by using the `-E` command +option. For more information about debugging connection failures, see +{xpack-ref}/trb-security-setup.html[`elasticsearch-setup-passwords` command fails due to connection failure]. [float] === Parameters @@ -68,5 +68,5 @@ its user management API requests: [source,shell] -------------------------------------------------- -bin/x-pack/setup-passwords auto -u "http://localhost:9201" +bin/elasticsearch-setup-passwords auto -u "http://localhost:9201" -------------------------------------------------- diff --git a/x-pack/docs/en/security/authentication.asciidoc b/x-pack/docs/en/security/authentication.asciidoc index eff10a6567d..8838a0fefbf 100644 --- a/x-pack/docs/en/security/authentication.asciidoc +++ b/x-pack/docs/en/security/authentication.asciidoc @@ -66,23 +66,23 @@ password. You must set the passwords for all built-in users. -The +setup-passwords+ tool is the simplest method to set the built-in users' -passwords for the first time. It uses the `elastic` user's bootstrap password to -run user management API requests. For example, you can run the command in -an "interactive" mode, which prompts you to enter new passwords for the -`elastic`, `kibana`, `logstash_system`, and `beats_system` users: +The +elasticsearch-setup-passwords+ tool is the simplest method to set the +built-in users' passwords for the first time. It uses the `elastic` user's +bootstrap password to run user management API requests. For example, you can run +the command in an "interactive" mode, which prompts you to enter new passwords +for the `elastic`, `kibana`, `logstash_system`, and `beats_system` users: [source,shell] -------------------------------------------------- -bin/x-pack/setup-passwords interactive +bin/elasticsearch-setup-passwords interactive -------------------------------------------------- For more information about the command options, see -{ref}/setup-passwords.html[setup-passwords]. +{ref}/setup-passwords.html[elasticsearch-setup-passwords]. IMPORTANT: After you set a password for the `elastic` user, the bootstrap -password is no longer valid; you cannot run the `setup-passwords` command a -second time. +password is no longer valid; you cannot run the `elasticsearch-setup-passwords` +command a second time. Alternatively, you can set the initial passwords for the built-in users by using the *Management > Users* page in {kib} or the diff --git a/x-pack/docs/en/security/configuring-es.asciidoc b/x-pack/docs/en/security/configuring-es.asciidoc index 8beb3537bb9..aab00fb225f 100644 --- a/x-pack/docs/en/security/configuring-es.asciidoc +++ b/x-pack/docs/en/security/configuring-es.asciidoc @@ -48,8 +48,8 @@ information, see -- {security} provides {xpack-ref}/setting-up-authentication.html#built-in-users[built-in users] to -help you get up and running. The +setup-passwords+ command is the simplest -method to set the built-in users' passwords for the first time. +help you get up and running. The +elasticsearch-setup-passwords+ command is the +simplest method to set the built-in users' passwords for the first time. For example, you can run the command in an "interactive" mode, which prompts you to enter new passwords for the `elastic`, `kibana`, `beats_system`, and @@ -57,15 +57,16 @@ to enter new passwords for the `elastic`, `kibana`, `beats_system`, and [source,shell] -------------------------------------------------- -bin/x-pack/setup-passwords interactive +bin/elasticsearch-setup-passwords interactive -------------------------------------------------- For more information about the command options, see <>. -IMPORTANT: The `setup-passwords` command uses a transient bootstrap password -that is no longer valid after the command runs successfully. You cannot run the -`setup-passwords` command a second time. Instead, you can update passwords from -the **Management > Users** UI in {kib} or use the security user API. +IMPORTANT: The `elasticsearch-setup-passwords` command uses a transient bootstrap +password that is no longer valid after the command runs successfully. You cannot +run the `elasticsearch-setup-passwords` command a second time. Instead, you can +update passwords from the **Management > Users** UI in {kib} or use the security +user API. -- diff --git a/x-pack/docs/en/security/securing-communications/configuring-tls-docker.asciidoc b/x-pack/docs/en/security/securing-communications/configuring-tls-docker.asciidoc index 37dbe486dbf..05d6574b56f 100644 --- a/x-pack/docs/en/security/securing-communications/configuring-tls-docker.asciidoc +++ b/x-pack/docs/en/security/securing-communications/configuring-tls-docker.asciidoc @@ -174,14 +174,14 @@ curl --cacert certs/ca/ca.crt -u elastic:PleaseChangeMe https://localhost:9200 ---- // NOTCONSOLE -- -. The `setup-passwords` tool can also be used to generate random passwords for -all users: +. The `elasticsearch-setup-passwords` tool can also be used to generate random +passwords for all users: + -- WARNING: Windows users not running PowerShell will need to remove `\` and join lines in the snippet below. ["source","sh"] ---- -docker exec es01 /bin/bash -c "bin/x-pack/setup-passwords \ +docker exec es01 /bin/bash -c "bin/elasticsearch-setup-passwords \ auto --batch \ -Expack.ssl.certificate=x-pack/certificates/es01/es01.crt \ -Expack.ssl.certificate_authorities=x-pack/certificates/ca/ca.crt \ diff --git a/x-pack/docs/en/security/troubleshooting.asciidoc b/x-pack/docs/en/security/troubleshooting.asciidoc index c4100ab8cac..80dcb6b01b5 100644 --- a/x-pack/docs/en/security/troubleshooting.asciidoc +++ b/x-pack/docs/en/security/troubleshooting.asciidoc @@ -336,11 +336,11 @@ Otherwise, {kib} cannot connect to {es}. [[trb-security-setup]] === Setup-passwords command fails due to connection failure -The {ref}/setup-passwords.html[setup-passwords command] sets passwords for -the built-in users by sending user management API requests. If your cluster uses -SSL/TLS for the HTTP (REST) interface, the command attempts to establish a -connection with the HTTPS protocol. If the connection attempt fails, the -command fails. +The {ref}/setup-passwords.html[elasticsearch-setup-passwords command] sets +passwords for the built-in users by sending user management API requests. If +your cluster uses SSL/TLS for the HTTP (REST) interface, the command attempts to +establish a connection with the HTTPS protocol. If the connection attempt fails, +the command fails. *Symptoms:* @@ -400,10 +400,10 @@ https://elasticsearch.example.com:9200/_xpack/security/_authenticate?pretty. *Resolution:* -. If your cluster uses TLS/SSL for the HTTP interface but the `setup-passwords` -command attempts to establish a non-secure connection, use the `--url` command -option to explicitly specify an HTTPS URL. Alternatively, set the -`xpack.security.http.ssl.enabled` setting to `true`. +. If your cluster uses TLS/SSL for the HTTP interface but the +`elasticsearch-setup-passwords` command attempts to establish a non-secure +connection, use the `--url` command option to explicitly specify an HTTPS URL. +Alternatively, set the `xpack.security.http.ssl.enabled` setting to `true`. . If the command does not trust the {es} server, verify that you configured the `xpack.security.http.ssl.certificate_authorities` setting or the diff --git a/x-pack/docs/en/setup/xpack-passwords.asciidoc b/x-pack/docs/en/setup/xpack-passwords.asciidoc index 841539ba197..0d9dc22f3b3 100644 --- a/x-pack/docs/en/setup/xpack-passwords.asciidoc +++ b/x-pack/docs/en/setup/xpack-passwords.asciidoc @@ -3,23 +3,24 @@ + -- If you have enabled {security}, it provides built-in user credentials to help you -get up and running. The +setup-passwords+ command is the simplest method to set -the built-in users' passwords for the first time. +get up and running. The +elasticsearch-setup-passwords+ command is the simplest +method to set the built-in users' passwords for the first time. For example, you can run the command in an "interactive" mode, which prompts you to enter new passwords for the `elastic`, `kibana`, and `logstash_system` users: [source,shell] -------------------------------------------------- -bin/x-pack/setup-passwords interactive +bin/elasticsearch-setup-passwords interactive -------------------------------------------------- For more information about the command options, see <>. -IMPORTANT: The `setup-passwords` command uses a transient bootstrap password -that is no longer valid after the command runs successfully. You cannot run the -`setup-passwords` command a second time. Instead, you can update passwords from -the **Management > Users** UI in {kib} or use the security user API. +IMPORTANT: The `elasticsearch-setup-passwords` command uses a transient +bootstrap password that is no longer valid after the command runs successfully. +You cannot run the `elasticsearch-setup-passwords` command a second time. +Instead, you can update passwords from the **Management > Users** UI in {kib} or +use the security user API. For more information, see {xpack-ref}/setting-up-authentication.html#set-built-in-user-passwords[Setting Built-in User Passwords]. diff --git a/x-pack/plugin/security/src/main/bin/setup-passwords b/x-pack/plugin/security/src/main/bin/elasticsearch-setup-passwords similarity index 100% rename from x-pack/plugin/security/src/main/bin/setup-passwords rename to x-pack/plugin/security/src/main/bin/elasticsearch-setup-passwords diff --git a/x-pack/plugin/security/src/main/bin/setup-passwords.bat b/x-pack/plugin/security/src/main/bin/elasticsearch-setup-passwords.bat similarity index 100% rename from x-pack/plugin/security/src/main/bin/setup-passwords.bat rename to x-pack/plugin/security/src/main/bin/elasticsearch-setup-passwords.bat diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordTool.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordTool.java index d429b32ba05..9675453186e 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordTool.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordTool.java @@ -428,7 +428,8 @@ public class SetupPasswordTool extends LoggingAwareMultiCommand { } } terminal.println(""); - terminal.println("It is recommended that you resolve the issues with your cluster before running setup-passwords."); + terminal.println( + "It is recommended that you resolve the issues with your cluster before running elasticsearch-setup-passwords."); terminal.println("It is very likely that the password changes will fail when run against an unhealthy cluster."); terminal.println(""); if (shouldPrompt) { diff --git a/x-pack/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash b/x-pack/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash index 9e9a90d1316..0de2cec585b 100644 --- a/x-pack/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash +++ b/x-pack/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash @@ -93,11 +93,11 @@ NODE_SETTINGS fi run sudo -E -u $ESPLUGIN_COMMAND_USER bash <<"SETUP_OK" -echo 'y' | $ESHOME/bin/setup-passwords auto +echo 'y' | $ESHOME/bin/elasticsearch-setup-passwords auto SETUP_OK echo "$output" > /tmp/setup-passwords-output-with-bootstrap [ "$status" -eq 0 ] || { - echo "Expected x-pack setup-passwords tool exit code to be zero but got [$status]" + echo "Expected x-pack elasticsearch-setup-passwords tool exit code to be zero but got [$status]" cat /tmp/setup-passwords-output-with-bootstrap debug_collect_logs false @@ -111,7 +111,7 @@ SETUP_OK users=( elastic kibana logstash_system ) for user in "${users[@]}"; do grep "Changed password for user $user" /tmp/setup-passwords-output-with-bootstrap || { - echo "Expected x-pack setup-passwords tool to change password for user [$user]:" + echo "Expected x-pack elasticsearch-setup-passwords tool to change password for user [$user]:" cat /tmp/setup-passwords-output-with-bootstrap false } diff --git a/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash b/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash index 229b7f1e305..d75f75b383a 100644 --- a/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash +++ b/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash @@ -155,10 +155,11 @@ start_node_using_package() { export ESHOME="$MASTER_HOME" export_elasticsearch_paths - # For the sake of simplicity we use a bootstrap password in this test. - # The alternative would be to start the master node, use setup-passwords - # and restart the node once ssl/tls is configured. Or use setup-passwords over - # HTTPS with the right cacerts imported into a Java keystore. + # For the sake of simplicity we use a bootstrap password in this test. The + # alternative would be to start the master node, use + # elasticsearch-setup-passwords and restart the node once ssl/tls is + # configured. Or use elasticsearch-setup-passwords over HTTPS with the right + # cacerts imported into a Java keystore. run sudo -E -u $MASTER_USER bash <<"NEW_PASS" if [[ ! -f $ESCONFIG/elasticsearch.keystore ]]; then $ESHOME/bin/elasticsearch-keystore create diff --git a/x-pack/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash b/x-pack/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash index 5d24c4147ba..14bd8be6826 100644 --- a/x-pack/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash +++ b/x-pack/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash @@ -1,3 +1,4 @@ + #!/usr/bin/env bats # Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one @@ -50,11 +51,11 @@ fi wait_for_xpack run sudo -E -u $ESPLUGIN_COMMAND_USER bash <<"SETUP_AUTO" -echo 'y' | $ESHOME/bin/setup-passwords auto +echo 'y' | $ESHOME/bin/elasticsearch-setup-passwords auto SETUP_AUTO echo "$output" > /tmp/setup-passwords-output [ "$status" -eq 0 ] || { - echo "Expected x-pack setup-passwords tool exit code to be zero" + echo "Expected x-pack elasticsearch-setup-passwords tool exit code to be zero" cat /tmp/setup-passwords-output false } @@ -67,7 +68,7 @@ SETUP_AUTO users=( elastic kibana logstash_system ) for user in "${users[@]}"; do grep "Changed password for user $user" /tmp/setup-passwords-output || { - echo "Expected x-pack setup-passwords tool to change password for user [$user]:" + echo "Expected x-pack elasticsearch-setup-passwords tool to change password for user [$user]:" cat /tmp/setup-passwords-output false } diff --git a/x-pack/qa/vagrant/src/test/resources/packaging/utils/xpack.bash b/x-pack/qa/vagrant/src/test/resources/packaging/utils/xpack.bash index 1cdd3bf7abe..1b1b9892c78 100644 --- a/x-pack/qa/vagrant/src/test/resources/packaging/utils/xpack.bash +++ b/x-pack/qa/vagrant/src/test/resources/packaging/utils/xpack.bash @@ -24,8 +24,8 @@ verify_xpack_installation() { 'migrate.bat' 'saml-metadata' 'saml-metadata.bat' - 'setup-passwords' - 'setup-passwords.bat' + 'elasticsearch-setup-passwords' + 'elasticsearch-setup-passwords.bat' 'sql-cli' 'sql-cli.bat' "sql-cli-$(cat version).jar" # This jar is executable so we pitch it in bin so folks will find it