Commit Graph

31 Commits

Author SHA1 Message Date
Dale Smith 1b00074c6a Bugfix: Clean up trusts for all deleted clusters
Cluster conductor creates trusts for all drivers, but does not clean
them up. The Heat driver has previously performed this action.

This change moves the lifecycle of trust and certificate creation
to the Conductor, so drivers do not need to clean up resources they
didn't create.

Change-Id: I2b3e99589d2d3069191d0727406601f0647a9722
2024-02-22 15:38:48 +13:00
Michal Nasiadka 68c8acba39 Remove execution bit on unnecessary files
Change-Id: Ia41b843fdf20154750b129a8ab5dd42f5c3989fb
2024-02-19 00:30:21 +00:00
Erik Olof Gunnar Andersson 718cb9c9b4 Add support for www_authentication_uri
We do currently not support www_authentication_uri at all, which
is the new standard, as auth_uri has long been deprecated.

* Make sure we support both auth_uri and www_authenticate_uri.
* Switched to www_authenticate_uri for devstack.
* Fixed a bug where a bad exception would be thrown if auth_uri
  was not set.
  
Story: 2004271
Task: 27819

Change-Id: Ibc932d35f3d6ba2ac7ffb6193aa37bd4a3d4422e
2018-11-06 17:13:10 +00:00
Lingxian Kong 3c8edd4d88 Add support for Octavia resources in Heat
Octavia is already an official LBaaS solution for Openstack
(https://governance.openstack.org/tc/reference/projects/octavia.html) and
will deprecate the neutron-lbaas extension starting from Queens release.

For deployment support Octavia service for load balancing functionlity,
Octavia related resources instead of LBaaS should be used in Heat template.

Tested in my DevStack environment.

Change-Id: Icc45e0a126c648fbcba4ebcd1bb258d60957f2d6
Closes-Bug: #1748577
2018-02-16 11:35:46 +13:00
coldmoment ba8ad5e37f Add a hacking rule for string interpolation at logging
String interpolation should be delayed to be handled
by the logging code, rather than being done at the point
of the logging call.
See the oslo i18n guideline
* https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages
and
* https://github.com/openstack-dev/hacking/blob/master/hacking/checks/other.py#L39

Change-Id: I8a4f5f896865aebbff88ee894f0081e58cfce9ef
2017-07-15 14:49:45 +08:00
yuanpeng 71d25456d2 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: If1f4bd2f6be967368f52fb367c5a428d3eb58a9d
Closes-Bug:#1674551
2017-03-30 17:05:10 +08:00
Jenkins dd2a8520cb Merge "Pass 'client', 'message' param to AuthorizationFailure Exception" 2017-03-11 11:29:00 +00:00
Vijendar Komalla 54152970e1 Set is_admin flag correctly in RequestContext
Currently is_admin flag is always False. As a result
some of the admin operations are not working.
For example, quotas-list is not listing all the
user quotas.
This change sets the flag correctly based on the
roles assigned to the user and policies defined
in policy.json.

Change-Id: I01534ccf1cf1e635282db497e0e026bea19c3bd2
Closes-Bug: #1660843
2017-03-03 03:37:08 +00:00
yatinkarel 44b83d3b14 Pass 'client', 'message' param to AuthorizationFailure Exception
Change-Id: Ia3f39a0362259429f4d2d995e94073a993ae48a7
Closes-Bug: #1666790
2017-02-25 04:37:41 +00:00
Johannes Grassler e93d82e8b3 Fix CVE-2016-7404
This commit addresses multiple potential vulnerabilities in
Magnum. It makes the following changes:

* Permissions for /etc/sysconfig/heat-params inside Magnum
  created instances are tightened to 0600 (used to be 0755).
* Certificate retrieval is modified to work without the need
  for a Keystone trust.
* The cluster's Keystone trust id is only passed into
  instances for clusters where that is actually needed. This
  prevents the trustee user from consuming the trust in cases
  where it is not needed.
* The configuration setting trust/cluster_user_trust (False by
  default) is introduced. It needs to be explicitely enabled
  by the cloud operator to allow clusters that need the
  trust_id to be passed into instances to work. Without this
  setting, attempts to create such clusters will fail.

Please note, that none of these changes apply to existing
clusters. They will have to be deleted and rebuilt to benefit
from these changes.

Change-Id: I643d408cde0d6e30812cf6429fb7118184793400
2017-02-09 16:44:27 +01:00
melissaml 2ee054c1f5 Modify variable's using method in Log Messages
String interpolation should be delayed to be handled by the logging code,
rather than being done at the point of the logging call.
Ref:http://docs.openstack.org/developer/oslo.i18n/guidelines.html#log-translation
For example:
LOG.info(_LI('some message: variable=%s') % variable)
LOG.info(_LI('some message: variable=%s'), variable)

Change-Id: Ifaf1dfe589615732e412c4e640cf46679abc9023
Closes-Bug: #1643463
2017-01-04 15:11:33 +08:00
Hieu LE 66430eaa98 Centralize config option: keystone_auth section
Centralize config option of keystone_auth section.
Replace oslo_conf cfg to magnum.conf.

Change-Id: I15eb976eb177b43a09743fcc116fdb05b985f69a
Implements: blueprint centralize-config-magnum
2016-09-22 05:57:53 +00:00
Hieu LE 5abcdadb51 Centralize config option: trust section
Centralize config option of trust section.
Replace oslo_conf cfg to magnum.conf.

Change-Id: Ie8e50f62bf41ccc1708b16745e5aaf841379b66b
Implements: blueprint centralize-config-magnum
2016-09-22 05:57:46 +00:00
Jaycen Grant 729c2d0ab4 Rename Bay DB, Object, and internal usage to Cluster
This is patch 3 of 3 to change the internal usage of the terms
Bay and BayModel.  This patch updates Bay to Cluster in DB and
Object as well as all the usages.  No functionality should be
changed by this patch, just naming and db updates.

Change-Id: Ife04b0f944ded03ca932d70e09e6766d09cf5d9f
Implements: blueprint rename-bay-to-cluster
2016-09-08 13:01:12 -07:00
Johannes Grassler f895b2bd09 Fix global stack list in periodic task
The periodic task unneccessarily lists Heat stacks in the
global tenant (across all tenants) which the Magnum service
user may lack permission for. Also, the most restrictive way
to let it use global stack-list is chose a Keystone role and
open that operation to any user in any project holding that
role.

This commit substitutes a direct lookup of all bays' stack_id
attributes for this global stack list. This direct lookup will
yield the same net result. In order to get the neccessary
permissions it will use each bay's stored Keystone trust to
act on behalf of the bay's creating user.

Co-Authored-By: Jiri Suchomel <jiri.suchomel@suse.com>
Closes-Bug: #1589955
Change-Id: I67b176c137c463e37e037970cc4e468d51db30c9
2016-07-27 10:11:51 +02:00
OTSUKA, Yuanying 1d74849193 Support trustee_domain_name in config file
To setup magnum easier, name based configuration is important.
This patch makes config file support trustee_domain_name and
trustee_domain_admin_name in trust section.
If name and id of trustee domain are provided by user, both
values are passed through into keystone.

Closes-Bug: #1581372
Change-Id: Ia691aca7c29a471f6ba36a1a371ec1edf830b365
2016-06-06 08:23:43 +09:00
OTSUKA, Yuanying 88124be84a Delete unused _admin_client variable
_admin_client variable in common/keystone.py isn't used anywhere.
So let's remove it!

Change-Id: I4cea8bb5654f74c6f1091bfd5e9e114701a23ccb
2016-05-30 13:44:20 +09:00
Gyorgy Szombathelyi f0a3487956 Honor insecure and cafile options in a trustee session
Pass the verify parameter to keystone when creating a
session with the trustee account.

Change-Id: Ic26d656fc434d097c2015db47b1539f83aaf3cd0
Closes-Bug: 1581057
2016-05-17 16:55:00 +02:00
Hua Wang e79d4a182f Bay can not be deleted by other users in the same project
Trust can only be deleted by the user who creates it. So when
other users in the same project want to delete the bay, we need
use the trustee which can impersonate the trustor to delete the
trust.

Change-Id: I9f87cdf07066d316722e798cd0755f0fff5c2a02
Closes-Bug: #1552457
2016-04-05 12:09:53 +08:00
Paulo Ewerton 7f145e703c Refactor Keystone client with keystoneauth
This patch does, basically, three things:

* Updates the default auth section to keystone_auth;
* Introduces keystoneauth sessions and plugins;
* Adds a deprecation warning and options when loading
legacy auth.

Config, tests and client code are also updated.

Co-Authored-By: Henrique Truta <henrique@lsd.ufcg.edu.br>
Co-Authored-By: Raildo Mascena <raildo@lsd.ufcg.edu.br>

Closes-Bug: 1496810
Closes-Bug: 1515014
Change-Id: I5c1cd24ca28d66ae7ae40e7f707b81870cf0e457
2016-03-23 16:24:53 +00:00
Eric Brown db676bcde0 Mark trustee_domain_admin_password secret
The trustee_domain_admin_password config option needs to be marked
secret in order to avoid leaking of the password into the logs.

Change-Id: I45d87b5fc09ffbc075cba2575869a8c5cf10bc8b
Closes-Bug: #1555276
2016-03-09 10:17:51 -08:00
wangqun 42d094b757 Get region_name that volume_driver rexray region_name needs
Config volume_driver rexray need region_name

The patch gets region_name, validates the region_name and add
Unit test.
Co-Authored By: Kai Qiang Wu(Kennan)<wkqwu@cn.ibm.com>
Co-Authored By: Ton Ngo<ton@us.ibm.com>
Partially-Implements: blueprint magnum-integrate-with-cinder
Change-Id: I3fcef0ffb7cda162fffcbedf4628cad81168d09d
2016-02-29 05:32:43 +00:00
Aaron-DH 526260278a Remove redundant password when create create_trustee
Closes-Bug: #1550195

Change-Id: I604b03bf432995b5a310aedf8cfac24196572728
2016-02-26 16:31:11 +08:00
Hua Wang 725bd5c99d Create a trustee user for each bay
Docker registry, k8s load balancer and volume driver have a similar
need to use trust, so we need to create a trustee for each bay.

Change-Id: If034e74ce2ea80a7faa886d4edf789e576c30eb5
Partially-Implements: blueprint create-trustee-user-for-each-bay
2016-02-18 18:16:35 +08:00
Jenkins 107e40bb5f Merge "Don't add exception in msg when using LOG.exception" 2016-01-08 21:56:57 +00:00
Hua Wang b9435c4efe Don't add exception in msg when using LOG.exception
LOG.exception can record the exception automatically, so we should
add exception in msg.

Change-Id: I60694fd8d1b1c0bd62461900c6746a0cc300cf5b
Closes-Bug: #1529534
2016-01-08 15:24:31 +08:00
Wanlong Gao 6ac4ce2eb1 Python 3 deprecated the logger.warn method in favor of warning
Python 3 deprecated the logger.warn method, see:
https://docs.python.org/3/library/logging.html#logging.warning, so we
prefer to use warning to avoid DeprecationWarning.

Closes-Bug: 1508442
Change-Id: I245d24b30e783f1c6dcec1b425d78d271edff49b
2015-12-29 13:09:04 +08:00
Hua Wang 8074f6f4ce Create trust_id for bay
All bays use the same trustee_user and different trust. A trust is
created for a bay when the bay is created, and is deleted when the
bay is deleted.

Partially-Implements: blueprint registryv2-in-master
Change-Id: Iab2037677f683fe4c562915b98303da02c59c299
2015-12-15 11:28:23 +08:00
Hua Wang d52237d89a Code refactor for keystoneclient
1.Rename magnum_keystone_client to keystone.
2.Code refactor to let keystoneclient can create trust for
any user, not only admin user.

Change-Id: Iac20185f2cc89ac8d6fe7cf30b2362302614df77
Partially-Implements: blueprint generate-keystone-trust
2015-09-22 17:32:24 +08:00
OTSUKA, Yuanying 3d1bff28ab Fix keystoneclient and heatclient incompatibility
Previous version of heat client couldn't work correctly
because of keystone auth error in actual use.
So, heat client and keystone client are copied from solum.

Change-Id: I49fef01bcec581f470e05aa82526b31fe47d0adc
2014-12-31 07:03:06 +09:00
OTSUKA, Yuanying 6919cad773 Add keystone client
This client will be used by novaclient and heatclient to create a bay.
The original sources are come from Ironic.

Change-Id: Ib075148afb0ddf503e71b333cef85523561a2732
2014-12-12 16:39:31 +09:00