Commit Graph

289 Commits

Author SHA1 Message Date
Ghanshyam Mann 1c87ebf9a8 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

CONF object needs to be initialized before policy enforcer(). That
need to remove cfg.CONF.unregister_opts from TestAuthUtils cleanup
as this is taken care by cfg.clear() with proper workflow otherwise
it end up with error
"oslo_config.cfg.ArgsAlreadyParsedError: arguments
already parsed: reset before unregistering options"

- https://b132754ee7062a9ab187-9add4719a9922a9385555a8552fc2366.ssl.cf5.rackcdn.com/768520/5/check/openstack-tox-py38/7964354/testr_results.html

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: I1b6c6485bc651fd0b87244a68204036dd4aa37f4
2021-03-07 17:50:48 -06:00
Erik Olof Gunnar Andersson e5d9d1b74f Use common rpc pattern for all services
This patch introduces a common rpc pattern to ensure
that the rpc transport is shared where possible. This
helps prevent rpc connection leaks and should ensure
that we are making the best possible use of all
available rpc connections.

Change-Id: Ib42e368cfda2b148a07df0bd74046739f40f7018
2021-01-19 12:24:08 -08:00
zhurong 7eca01a7d6 Fix pep8 error
Change-Id: I2832b70a6eeb2b9edf2124977e4be362e0eedabe
2020-05-13 14:03:53 +08:00
Zuul f93d1e5148 Merge "Remove six murano/dsl" 2020-04-20 01:58:19 +00:00
zhurong 91c0f48a30 Remove six murano/dsl
Change-Id: Iac776e29eb63421577cb928692f2945200f32b1d
2020-04-17 23:32:45 -07:00
zhurong d3f05df5cc Remove six murano/common
Change-Id: Iac6e4e4c1dde1b661dd3e9a0055cea6f9f11817d
2020-04-17 18:52:59 -07:00
zhurong 4ee97f7b7a Bump to hacking 1.1.0
Change-Id: I4019f41d9ddd843872855e6e80c0667ee2df758a
2019-07-04 11:51:47 +00:00
zhurong ea03ab3e7c Using trustor's session to delete the trust
Now use admin client to delete the trust gives the error:
"You are not authorized to perform the requested action:
Only admin or trustor can delete a trust.: ForbiddenAction:
You are not authorized to perform the requested action:
Only admin or trustor can delete a trust."

This patch use trustor's session to delete the trust.

Change-Id: Ib673128be860f548195181a465a9dff784cdef1a
2019-01-23 10:56:53 +08:00
zhurong c023d63562 use get_rpc_transport to obtain an RPC transport instance
Change-Id: I4aaef5eb52500f597fa8270c71dd4816167e69cb
2019-01-08 19:43:11 +08:00
zhurong 251dfc3672 Fix unittest no such option None in group DEFAULT error
Change-Id: Ic3dc1870052bd1a0db844aa84cd8984dd64510e8
2018-12-12 10:47:13 +08:00
zhurong ed7941c346 Sanitizer some sensitive logs information
Murano engine maybe outputs some sensitive logs information,
This patch sanitizer the sensitive info.

Change-Id: Icd24a0388274454af335ce217614606b9bad0344
Closes-Bug: #1655265
2018-07-27 11:07:32 +08:00
chenaidong1 a4931ab8d9 Use V3 auth_url
When executing 'murano environment create test' command, the result
is failed because keystone has delete V2 api. Therefore murano need
to use V3 auth_url.

Change-Id: Ia9874949c0e7bdef733815ae6d37a3f19784abe3
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
2018-07-21 14:32:41 +08:00
wu.chunyang 7a64448917 Update auth_uri option to www_authenticate_uri
Option auth_uri from group keystone_authtoken is deprecated[1].
Use option www_authenticate_uri from group keystone_authtoken.

[1]: https://review.openstack.org/#/c/508522/

Change-Id: Ib8623a359a27b8a4aa90bf69a3fe3f3a5c2411a6
2018-05-12 06:34:14 +00:00
Stan Lagun ef3b0d4f7d Option to configure pip source for murano-agent
With this small changes it becomes possible to instruct murano to
provision murano-agent of version other than latest, or from
custom git branch or from a http source.

Use cases:
* Use agent with custom modifications that are not available in
  PyPI version
* Development of new agent features - agent can be installed from
  the private git repo
* Environments without internet connectivity

Change-Id: Icbea95abf070ef35781474a54461cc34bb9927af
2018-01-17 02:39:01 +00:00
Stan Lagun 6f6897c132 Murano-engine side implementation of agent message signing
Change-Id: I1a23d185ac19f10c98d66f29a6930dfd17793954
Partial-Blueprint: message-signing
2018-01-15 16:56:54 +00:00
Guoqiang Ding 10c58ddce7 Fix the deprecated usage of "get_transport"
As log says, 'oslo_messaging.transport.get_transport()' is deprecated.
The reference link of oslo_messaging is at [1].

[1] https://review.openstack.org/#/c/454194/

Change-Id: I89061bd348988f9555f6bb77875bfdbf0aa76d07
2017-12-19 03:24:29 +00:00
Stan Lagun 6674e065da Use secure path join
Change-Id: If0eeef8b025b1f3be863728a8def81d944873ac5
Closes-bug: #1729214
2017-11-01 16:49:05 -07:00
Gyorgy Szombathelyi 64a798a2de Remove fallback to [keystone_authtoken]
Since [murano_auth] section is introduced in Pike, no need to
fallback to [keystone_authtoken] now.

Change-Id: I24e2475997feb9fdcf388af03d51fd5ced9e3885
2017-09-13 13:30:49 +02:00
Jeremy Liu 4661d8b147 Remove unused param
Change-Id: I11dcedf58a96da9b92f83f6dc3d51c3b0dc6a322
2017-09-03 22:27:54 +08:00
Margarita Shakhova 3877f610ef Implement environment audit reports
Add notifications about environment events that are required for
tracking. These are AMQP notifications and oslo.messaging library
is used for sending them.

The follow event types are provided:

 - environment.deploy.end
   This event is issued on successful finish of environment deployment,
   provides general information about environment and also deployment
   start and finish times

 - environment.delete.end
   This event is issued on environment delete (and abandon as well)

 - environment.exists
   This is a period event, it's issued for every existing environment
   that has successful deployments

There are 2 new configuration options controlling these notifications:

 - stats.env_audit_period
   Controls how often to send environment.exists notification, by
   it's once per hour (60 minutes)

 - env_audit_enabled
   Allows to completely disable environment-related notifications. By
   default notifications are enabled.

Change-Id: I8dee2456b7ccab7c0c167aa21abb9710959ebb30
2017-08-24 10:11:35 +00:00
zhurong efbe5ca5d1 Deploy murano-api via uwsgi
The patch add the devstack install murano-api via uwsgi.

Implements: blueprint murano-api-wsgi
Change-Id: I3b83a0295cf60de24ff90cabfcbbc3cfb0171905
2017-08-15 14:02:03 +08:00
Jenkins 80b8861594 Merge "Update the documentation link for doc migration" 2017-08-01 01:25:38 +00:00
Hangdong Zhang 4ecefa3a0b Update the documentation link for doc migration
Change-Id: I6a127e1194702cf2a158e1bbe6eb6ce6cadac386
2017-07-31 16:54:11 +08:00
Gyorgy Szombathelyi 78abdaa130 Use consistent session options
Various components defines different options for the client sessions.
Standardize them with the help of keystonauth1 lib.

Change-Id: I2f791caaf230a58b8426d1c1d6e1eb4316a85a28
2017-07-28 14:55:45 +02:00
Gyorgy Szombathelyi 25317e3801 Fix murano_auth usage
Use the OpenStack standard keystoneauth1 library for loading
authentication plugins and register their options in the
murano_auth section.
Still provide a fallback if no murano_auth.auth_type is specified
to make old config files work.

Closes-bug: 1705838
Change-Id: Ie74364a4401f64fe42bf2206b6df760d2fc60edb
2017-07-27 12:40:14 +02:00
Margarita Shakhova 9a4bafa5d4 Add dsl_iterators_limit config option
To remove hardcoded constant called 'ITERATORS_LIMIT', that can be
exceeded (2000) having big amount of objects. It is easy to achieve
in big cloud with user that is allowed to view lots of resources.

Change-Id: I818561ca044bad505402b69d22a41ea892e15fcc
Closes-Bug: #1690179
2017-07-05 23:40:27 +00:00
Felipe Monteiro fb1a2d5bbe Remove murano default policy.json
This commit removes the murano default policy.json file from
etc/murano and references to it in murano's devstack plugin.
(References to the policy.json in muranodashboard remain
the same).

This commit specifically:
  - removes the default policy.json
  - removes references to it in devstack plugin
  - adds base rules to murano.common.policies.__init__ because
    they are the last rules to be included
  - updates base admin_api rule to is_admin:True from
    is_admin:1 (because the latter was causing issues)
  - updates Murano policy documentation

Partially Implements: blueprint policy-in-code
Depends-On: Ia372983d2bd1010cd19f04061f3276ed16e9c1c9
Change-Id: I1a8581a559e4333a74d56a5bdce7e6d1f117907d
2017-06-16 03:07:49 +00:00
Felipe Monteiro 640f926092 Policy in code for actions/static actions
This commit implements policy in code for (static) actions
API. The default rules for the (static) actions API were
removed from the policy.json and moved into code under
`murano.common.policies.action`.

This commit specifically:
  - Moves policy actions related to the (static) actions
    API from the policy.json into code.
  - Documents the API information and paths associated with
    each actions-related policy.

Partially Implements: blueprint policy-in-code
Change-Id: Ia372983d2bd1010cd19f04061f3276ed16e9c1c9
2017-06-14 19:25:04 +01:00
Felipe Monteiro 12024a7ae2 Policy in code for categories
This commit implements policy in code for categories
API. The default rules for the categories API were
removed from the policy.json and moved into code under
murano.common.policies.category.

This commit specifically:
  - Moves policy actions related to the categories
    API from the policy.json into code.
  - Documents the API information and paths associated with
    each category-related policy.

Partially Implements: blueprint policy-in-code
Change-Id: I7171369650d7d55ed44154481d03d48153f3640a
2017-06-09 18:11:16 +01:00
Felipe Monteiro 5a06c48d02 Policy in code for deployments
This commit implements policy in code for deployments
API. The default rules for the deployments API were
removed from the policy.json and moved into code under
murano.common.policies.deployment.

This commit specifically:
  - Moves policy actions related to the deployments
    API from the policy.json into code.
  - Documents the API information and paths associated with
    each deployment-related policy.

Partially Implements: blueprint policy-in-code
Change-Id: I246261b6df4b5225b67499c89281b942013007ed
2017-06-07 19:25:48 +00:00
Felipe Monteiro 7a01e294ff Policy in code for packages
This commit implements policy in code for packages
API. The default rules for the packages API were
removed from the policy.json and moved into code under
murano.common.policies.env_template.

This commit specifically:
  - Moves policy actions related to the packages
    API from the policy.json into code.
  - Documents the API information and paths associated with
    each package policy.

Partially Implements: blueprint policy-in-code
Change-Id: I9a091606bec7c74ce7cf53fd327a2a40c6b9c364
2017-06-06 14:02:00 +01:00
Felipe Monteiro f8c346230c Policy in code for environment templates
This commit implements policy in code for the environment templates
API. The default rules for the environment templates API were
removed from the policy.json and moved into code under
murano.common.policies.env_template.

This commit specifically:
  - Moves policy actions related to the environment templates
    API from the policy.json into code.
  - Documents the API information and paths associated with
    each environment template policy.
  - Updates the ``create_environment`` policy action documentation
    in murano.common.policies.environment to include API
    /v1/templates/{env_template_id}/create-environment
    which enforces this policy as well.

Partially Implements: blueprint policy-in-code
Change-Id: I715f4b0a61fd4404e20b88736a9a4c86fc038b55
2017-06-02 17:16:03 +01:00
Felipe Monteiro 5b01f9464b Policy in code
This patch introduces the beginning implementation for registering
default policy rules in code. Default rules are defined under
murano.common.policies. Each API's policies are defined in a
sub-folder under that path and __init__.py contains all the
default policies in code which are registered in the ``init``
enforcer function in murano/common/policy.py.

The default rules for the environments API was removed from the
policy.json and moved into code under
murano.common.policies.environment. This can be gradually done
for the rest of the APIs in follow-up patches.

This commit does the following:
  - Creates the ``policies`` module that contains all the default
    policies in code.
  - Adds the base policy rules into code (the admin_api,
    context_is_admin, and default rules).
  - Adds the environment default policy module with default
    policy rules for the environments API.

Partially Implements: blueprint policy-in-code

Change-Id: Iebf2c60d1d31b73829fad189ada7ceee28e714bd
2017-05-31 15:20:18 +00:00
Huangsm 9ee24d9389 Modify Default Domain
From 2016/10, there is no domain with name 'Default' in keystone.
And the user would create a domain whith name 'default', like this:
https://docs.openstack.org/mitaka/install-guide-obs/keystone-users.html
If there is no domain_name in murano.conf, set the default domain with name
'default'.

Change-Id: I1aa9efe4119c586bd6fb6c9442560813530a5e9d
2017-05-15 11:41:05 +08:00
Jenkins ea4a304398 Merge "Replace six.iteritems() with .items()" 2017-05-03 20:35:15 +00:00
M V P Nitesh 580677eedc Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more readable.
2.In py2, the performance about list should be negligible, see the
link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I45fa65427318e1c35bb521de46e81ea12ca7b770
2017-05-03 09:17:18 +00:00
zhurong 0a94ad59fb Make get_token_client_session get auth_uri from murano_auth section
Change-Id: If2dbe0c2cec64fa25ac0a3a0c721968785e58d12
2017-05-02 07:15:25 +00:00
Nicolas 802f8607e1 Add bandit job to the pep8 gate for Murano
This patch updates the pep8 tox job to also run bandit,
as is the convention across most projects.
The predefined bandit tox job is referenced by the pep8 tox job.

Change-Id: Ief99196c04f69499bcf328ec202971f82ff3c32e
2017-04-27 23:22:20 +00:00
Nicolas 6bc1d221f8 Changed admin pass to include secret marker
as per bandit linting error 109

Closes-Bug: #1686462
Change-Id: Idfa0a471d37764188ae333bcbfb88a29ef4ddd62
2017-04-18 11:30:07 -07:00
zhurong 75b47bbabd Make murano auth with murano_auth section instend of keystone_authtoken
This patch add a murano_auth for murano auth with keystone,
This gives ability to fine-tune role-based privileges for
service-user going to execute trust-delegated tasks and the auth
configuration properties do not need to change when keystonemiddleware
deprecates its configuration properties.

Closes-Bug: #1643583
Closes-Bug: #1658648
Change-Id: If10fa8c938c264c7b5cadb3c3ed77f39488dcab7
2017-04-21 10:37:44 +08:00
dineshbhor 705a81a216 Set access_policy for messaging's dispatcher
oslo.messaging allow dispatcher to restrict endpoint methods since
5.11.0 in I42239e6c8a8be158ddf5c3b1773463b7dc93e881, set with
LegacyRPCAccessPolicy explicitly to ensure it's compatible and
fix FutureWarning like:

"The access_policy argument is changing its default value to <class
'oslo_messaging.rpc.dispatcher.DefaultRPCAccessPolicy'> in version '?',
please update the code to explicitly set None as the value:
access_policy defaults to LegacyRPCAccessPolicy which exposes private
methods. Explicitly set access_policy to DefaultRPCAccessPolicy or
ExplicitRPCAccessPolicy.

Change-Id: I60dfaa09113ebf2460126c968e5839f1b6a4bda9
2017-04-08 12:13:31 +05:30
shihanzhang 06746baa32 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: I24ca32d9e92cdd2b3a91916337839d116e335084
2017-04-03 12:11:20 +08:00
lingyongxu 895f051ad4 Replaces uuid.uuid4 with uuidutils.generate_uuid()
Openstack common has a wrapper for generating uuids. We should
use that function to generate uuids for consistency.

Change-Id: I9b6ba92d97c3f2d18b55752c1365184c5c342540
2017-03-27 10:36:35 +08:00
jeremy.zhang 117a9063f6 Use HostAddressOpt for opts that accept IP and hostnames
Some configuration options were accepting both IP addresses
and hostnames. Since there was no specific OSLO opt type to
support this, we were using ``StrOpt``. The change [1] that
added support for ``HostAddressOpt`` type was merged in Ocata
and became available for use with oslo version 3.22.

This patch changes the opt type of configuration options to use
this more relevant opt type - HostAddressOpt.

[1] I77bdb64b7e6e56ce761d76696bc4448a9bd325eb

Change-Id: I818d4a8f6741ae4c76f36932b469537f93eaab82
2017-03-23 10:03:25 +08:00
Felipe Monteiro 2f5d9e28cc Adds TLS/SSL Version Support to Murano Engine.
Currently, Murano supports enabling SSL in Murano Engine [0],
but does not have a param for the user to specify the
desired SSL version. This is important because some
versions of SSL are less secure than others [1].

[0] https://docs.openstack.org/developer/murano/administrator-guide/deploy_murano/configure_ssl.html
[1] https://www.wolfssl.com/wolfSSL/Blog/Entries/2010/10/7_Differences_between_SSL_and_TLS_Protocol_Versions.html

Change-Id: I71c36c455cde658f402a19c59d7966cee8544cf1
Partially-Implements: blueprint add-tls-support
2017-03-13 12:24:28 -04:00
xpress 3da434357b cors: update default configuration
Set_defaults has been added into oslo_middleware. So we use it to
override the configuration defaults.

Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
Change-Id: I5d624ac46f17c5628d30c983efe1417e7dc5ca6a
2017-02-07 14:39:18 +08:00
Jeremy Liu 2c7131337f Marking rabbitmq password config property as secret
Set `secret=True` so that its value will not be printed in logs to avoid
some security problems [1].

[1] https://github.com/openstack/oslo.config/blob/master/oslo_config/cfg.py#L767

Change-Id: I9f41f334e0f32ee31c40c27c977ed801a68830e7
2017-01-18 17:12:37 +08:00
Felipe Monteiro a8cae53126 Increase unit test coverage for Common WSGI.
implements bp: murano-unit-test-coverage

Also decreased time it takes these tests by a few minutes and fixed a
few typos in wsgi.py.

Change-Id: I83ed6fcab4f95151e1bef46b280f51f7e12e1c73
2017-01-15 17:08:57 +00:00
Jenkins 3d7159ec6d Merge "Add log translation marker" 2016-12-13 03:19:51 +00:00
Jenkins 9a8b0d6f0a Merge "Replace six iteration methods with standard ones" 2016-12-08 02:25:04 +00:00