From e636a56c502815903c95f1d2df0bc818034fea51 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Mon, 29 Oct 2018 21:21:21 -0400 Subject: [PATCH] rgw: move keystone secrets from ceph.conf to files Permits setting restrictive permissions on these secrets. Fixes: http://tracker.ceph.com/issues/36621 Signed-off-by: Matt Benjamin --- doc/radosgw/config-ref.rst | 29 +++++++++++++++-- doc/radosgw/keystone.rst | 2 ++ src/common/legacy_config_opts.h | 2 ++ src/common/options.cc | 12 +++++-- src/rgw/rgw_keystone.cc | 57 +++++++++++++++++++++++++++++++++ src/rgw/rgw_keystone.h | 14 ++++---- src/rgw/rgw_main.cc | 6 ++++ 7 files changed, 109 insertions(+), 13 deletions(-) diff --git a/doc/radosgw/config-ref.rst b/doc/radosgw/config-ref.rst index abaeafba821..3e95100772d 100644 --- a/doc/radosgw/config-ref.rst +++ b/doc/radosgw/config-ref.rst @@ -763,11 +763,26 @@ Keystone Settings authentication with the admin credentials (``rgw keystone admin user``, ``rgw keystone admin password``, ``rgw keystone admin tenant``, ``rgw keystone admin project``, - ``rgw keystone admin domain``). Admin token feature is considered - as deprecated. + ``rgw keystone admin domain``). The Keystone admin token + has been deprecated, but can be used to integrate with + older environments. Prefer ``rgw keystone admin token path`` + to avoid exposing the token. :Type: String :Default: None +``rgw keystone admin token path`` + +:Description: Path to a file containing the Keystone admin token + (shared secret). In Ceph RadosGW authentication with + the admin token has priority over authentication with + the admin credentials + (``rgw keystone admin user``, ``rgw keystone admin password``, + ``rgw keystone admin tenant``, ``rgw keystone admin project``, + ``rgw keystone admin domain``). + The Keystone admin token has been deprecated, but can be + used to integrate with older environments. +:Type: String +:Default: None ``rgw keystone admin tenant`` @@ -788,7 +803,15 @@ Keystone Settings ``rgw keystone admin password`` :Description: The password for OpenStack admin user when using OpenStack - Identity API v2 + Identity API v2. Prefer ``rgw keystone admin password path`` + to avoid exposing the token. +:Type: String +:Default: None + +``rgw keystone admin password path`` + +:Description: Path to a file containing the password for OpenStack + admin user when using OpenStack Identity API v2. :Type: String :Default: None diff --git a/doc/radosgw/keystone.rst b/doc/radosgw/keystone.rst index 398276c74a5..db283e04cbf 100644 --- a/doc/radosgw/keystone.rst +++ b/doc/radosgw/keystone.rst @@ -14,6 +14,7 @@ The following configuration options are available for Keystone integration:: rgw keystone api version = {keystone api version} rgw keystone url = {keystone server url:keystone server admin port} rgw keystone admin token = {keystone admin token} + rgw keystone admin token path = {path to keystone admin token} #preferred rgw keystone accepted roles = {accepted user roles} rgw keystone token cache size = {number of tokens to cache} rgw keystone revocation interval = {number of seconds before checking revoked tickets} @@ -32,6 +33,7 @@ configuration options for are:: rgw keystone admin user = {keystone service tenant user name} rgw keystone admin password = {keystone service tenant user password} + rgw keystone admin password = {keystone service tenant user password path} # preferred rgw keystone admin tenant = {keystone service tenant name} diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index e1d5e8458d2..b85d7147b5e 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1314,8 +1314,10 @@ OPTION(rgw_swift_account_in_url, OPT_BOOL) // assume that URL always contain th OPTION(rgw_swift_enforce_content_length, OPT_BOOL) // enforce generation of Content-Length even in cost of performance or scalability OPTION(rgw_keystone_url, OPT_STR) // url for keystone server OPTION(rgw_keystone_admin_token, OPT_STR) // keystone admin token (shared secret) +OPTION(rgw_keystone_admin_token_path, OPT_STR) // path to keystone admin token (shared secret) OPTION(rgw_keystone_admin_user, OPT_STR) // keystone admin user name OPTION(rgw_keystone_admin_password, OPT_STR) // keystone admin user password +OPTION(rgw_keystone_admin_password_path, OPT_STR) // path to keystone admin user password OPTION(rgw_keystone_admin_tenant, OPT_STR) // keystone admin user tenant (for keystone v2.0) OPTION(rgw_keystone_admin_project, OPT_STR) // keystone admin user project (for keystone v3) OPTION(rgw_keystone_admin_domain, OPT_STR) // keystone admin user domain diff --git a/src/common/options.cc b/src/common/options.cc index 49cb29a08f6..d8507244471 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -5296,7 +5296,11 @@ std::vector