11336 Commits

Author SHA1 Message Date
Lance Bragstad
ff883486e6 Implement system scoped RBAC for node and driver passthru
This commit updates the policies for baremetal passthru policies to understand
scope checking and account for a read-only role. This is part of a broader
series of changes across OpenStack to provide a consistent RBAC experience and
improve security.

Change-Id: I31a258e0ce7db7e931e62f2a06e610857dabdd47
2021-02-22 05:49:11 -08:00
Lance Bragstad
9e773d96ca Implement system scoped RBAC for baremetal drivers
This commit updates the policies for baremetal drivers to understand scope
checking and account for a read-only role. This is part of a broader series of
changes across OpenStack to provide a consistent RBAC experience and improve
security.

Change-Id: I7e2f205a5fbc186bfdaf2f5f58fb3b07abc9765d
2021-02-22 05:46:15 -08:00
Lance Bragstad
eb8d7d6a8e Implement system scoped RBAC for chassis
This commit updates the policies for baremetal chassis to understand scope
checking and account for a read-only role. This is part of a broader series of
changes across OpenStack to provide a consistent RBAC experience and improve
security.

Change-Id: I5ecb44a389b057519599c7b812f8c913db4f085a
2021-02-22 05:45:53 -08:00
Lance Bragstad
4fe64c9702 Implement system scoped RBAC for port groups
This commit updates the policies for baremetal port groups to understand scope
checking and account for a read-only role. This is part of a broader series of
changes across OpenStack to provide a consistent RBAC experience and improve
security.

Co-Authored-By: Julia Kreger <juliaashleykreger@gmail.com>
Change-Id: Ida3b341285e3f889311a44f615e0665a0736f6af
2021-02-22 05:45:42 -08:00
Lance Bragstad
34edc6444e Implement "system" scoped RBAC for ports
This commit updates the policies for baremetal ports to understand scope
checking and account for a read-only role. This is part of a broader
series of changes across OpenStack to provide a consistent RBAC
experience and improve security.

Co-Authored-By: Julia Kreger <juliaashleykreger@gmail.com>
Change-Id: I0ff52a5b667cffdb93e210f5ef32c1d38953d6ee
2021-02-22 05:45:23 -08:00
Lance Bragstad
b0d8d14065 Implement "system" scoped RBAC for the node endpoint
This commit updates the policies for baremetal nodes to understand
scope checking and account for a member or read-only role.

This is part of a broader series of changes across OpenStack
to provide a consistent RBAC experience and improve security.

This change also implements basic testing of the RBAC interface, and
modifies the testing test_acl.py file to *both* delineate the tests
to prevent yaml variable expansion collission as well as handle
deprecated ACL testing so we can track our way through the API
and disable deprecated tests from providing false errors.

A notable difference between the testing is that members in the
system role *have* rights under the system scope. Members accounts
may be services such as nova-compute running the nova.virt.ironic
driver.

Co-Authored-By: Julia Kreger <juliaashleykreger@gmail.com>
Change-Id: Id8365f150f8f5828b99627e1f31b0bc30f3a28f2
2021-02-22 05:45:01 -08:00
Jacob Anders
b66471e39d Add support for using NVMe specific cleaning
This change adds support for utilising NVMe specific cleaning tools
on supported devices. This will remove the neccessity of using shred to
securely delete the contents of a NVMe drive and enable using nvme-cli
tools instead, improving cleaning performance and reducing wear on the device.

Story: 2008290
Task: 41168
Change-Id: I2f63db9b739e53699bd5f164b79640927bf757d7
2021-02-22 23:03:41 +10:00
Dmitry Tantsur
8e458d89bf Trivial: fix incorrect ordering in iLO tests
Change-Id: Ic1d951897a96cb9a98fbda59258bd9ed813cfe7e
2021-02-19 17:06:31 +01:00
Riccardo Pittau
52c01f87cc Enforce autospec in test_notification_utils module
And remove tox.ini filter

Change-Id: I29257c805ce0afb01ae9422671d71d225f4b2573
2021-02-19 13:16:29 +00:00
Riccardo Pittau
6ed75bc6cf Enforce autospec in test_node
And remove filter from tox.ini

Also sets noqa for 2 mocks to keep ignoring autospec.

Change-Id: I0eadacf87baf68bc1c6547aac562f85edcad1aa3
2021-02-19 14:16:01 +01:00
Zuul
6ae5bc4642 Merge "Correct release mappings for 16.2" 2021-02-19 11:41:53 +00:00
Zuul
23d2ec6411 Merge "Validate configdrive string format" 2021-02-19 07:50:53 +00:00
Dmitry Tantsur
16e3c6662b Correct release mappings for 16.2
The deploy_steps change merged after they got updated for 16.2.

Change-Id: Ibc9e5707518243bda31135e4012877284dad72a4
2021-02-18 18:16:26 +01:00
Dmitry Tantsur
73bdebd127 Fix broken configdrive_use_object_store
When it is set to True, we try to write text data to a binary file,
which is not possible in Python 3. The issue has been "helpfully"
hidden by the fact that we use bytes in unit tests, as well as
by lack of CI coverage.

Change-Id: Ibbf90dcbcb36a5f7cf084a44a221c0c5c003b95a
2021-02-18 10:25:07 +01:00
Dmitry Tantsur
6e09a008ab Replace pysendfile with os.sendfile
Change-Id: I1ef33d41fd3784f55929fa6a086fca0c335212e5
2021-02-18 10:16:57 +01:00
Zuul
3858b95204 Merge "Report the slowest tests after a test run" 2021-02-18 05:27:54 +00:00
Zuul
164086d331 Merge "Enforce autospec in test_chassis" 2021-02-18 05:27:44 +00:00
Zuul
eb54fbb18b Merge "Replace retrying with tenacity" 2021-02-18 04:15:03 +00:00
Zuul
6b9d7fa407 Merge "devstack: support installing ironic-lib from source in DIB IPA" 2021-02-18 04:04:40 +00:00
Dmitry Tantsur
cf5deb77ab Validate configdrive string format
The ironicclient CLI silently passes invalid JSON as a configdrive
blob, which fails much later with a confusing errors. Add an early
check in the API.

Change-Id: Ifa9993a9454fe036a600ca8b855397321d4fbc04
2021-02-17 13:38:04 +01:00
Riccardo Pittau
437cae984d Enforce autospec in test_chassis
And remove corresponding tox.ini filter

Change-Id: Id52e736c73f491faf04d2691a1f2ef0441b94111
2021-02-17 11:56:17 +01:00
Zuul
17952a9756 Merge "Switch multinode jobs to 512M RAM" 2021-02-15 19:10:28 +00:00
Boden R
b0607a2668 Replace retrying with tenacity
We are replacing all usages of the 'retrying' package with
'tenacity' as the author of retrying is not actively maintaining
the project.
Unit tests will be added/removed where applicable.

Tenacity [1] is a fork of retrying, but has improved the
interface and extensibility.
Our end goal here is removing the retrying package from our
requirements.

Tenacity provides the same functionality as retrying, but has the
following major differences to account for:
- Tenacity uses seconds rather than ms as retrying did.
- Tenacity has different kwargs for the decorator and
Retrying class itself.
- Tenacity has a different approach for retrying args by
using classes for its stop/wait/retry kwargs.
- By default tenacity raises a RetryError if a retried callable
times out; retrying raises the last exception from the callable.
Tenacity provides backwards compatibility here by offering
the 'reraise' kwarg.
- For retries that check a result, tenacity will raise if the retried
function raises, whereas retrying retried on all exceptions.

[1] https://github.com/jd/tenacity

Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com>
Co-Authored-By: Riccardo Pittau <elfosardo@gmail.com>
Story: #1635390
Task: #10528
Change-Id: Ie5eb3ddc196505e8f58ed14de9952284598586fb
2021-02-15 17:11:33 +01:00
Zuul
71ebba5cf3 Merge "Add some tuning documentation" 2021-02-15 15:41:20 +00:00
Dmitry Tantsur
414f0ca24e Switch multinode jobs to 512M RAM
384M no longer works reliably with newer tinyIPA.

Change-Id: I7e48b2e682dc0d5e6109e17b0e73ee9763a29d23
2021-02-15 16:20:24 +01:00
Zuul
ec61274e5f Merge "Move the IPv6 job to the experimental pipeline" 2021-02-15 12:13:46 +00:00
Zuul
a2cc1baa86 Merge "Address some rbac review feedback in merged patches" 2021-02-15 07:03:59 +00:00
Julia Kreger
bb30f9945c Add some tuning documentation
Change-Id: I56e3c45bf7ae89b3f96ee826565bf153908d1bf7
2021-02-13 14:28:07 +00:00
Zuul
d65c486592 Merge "Set default to prevent out of memory conditions" 16.2.0 2021-02-12 22:46:46 +00:00
Zuul
1adee0cf5d Merge "Introduce common personas for secure RBAC" 2021-02-12 18:20:34 +00:00
Zuul
4b6a18f24c Merge "Trivial: update version for deploy steps" 2021-02-12 18:12:30 +00:00
Zuul
52ff615c98 Merge "Guard conductor from consuming all of the ram" 2021-02-12 18:11:57 +00:00
Dmitry Tantsur
7c8d1e1e7f Move the IPv6 job to the experimental pipeline
It's broken for months and no effort is under way to fix it.

Change-Id: I88fb5733b3054c2ffa4660f3cb5bff3c852faa75
2021-02-12 17:08:47 +01:00
Dmitry Tantsur
7eadc52403 Trivial: update version for deploy steps
Change-Id: I4aac0a9f2e9bd1ae40f41722ab75e92f2a09cfef
2021-02-12 17:04:06 +01:00
Zuul
766d8f11b4 Merge "Add 'deploy steps' parameter for provisioning API" 2021-02-12 16:01:33 +00:00
Julia Kreger
e3ccb9ec22 Address some rbac review feedback in merged patches
Some of the early test changes for the RBAC work have merged
which is awesome, but a couple minor follow-up items should be
addressed. They are so minor it doesn't really make sense to merge
in with one of the patches in the chain.

Change-Id: I85de4d953237f240c3c220f6a57169c633fb295f
2021-02-12 06:56:31 -08:00
Lance Bragstad
e77d1b553a Introduce common personas for secure RBAC
This commit lays down some common personas we're trying to introduce
across OpenStack services. Later commits will use these personas in
ironic's existing policies.

This will help use improve the security posture of OpenStack as a whole
and provide a more consistent experience operators and end users.

Change-Id: I2960d0f808949582dc964f4f5688a462d397de9e
2021-02-12 06:42:08 -08:00
Zuul
497f349275 Merge "Duplicate testing for system scoped ACL testing" 2021-02-12 13:20:43 +00:00
Zuul
b22429fa8b Merge "Populate existing policy tests" 2021-02-12 13:20:10 +00:00
Zuul
71a875facc Merge "Prepare 16.2 and clean up release note" 2021-02-11 21:04:41 +00:00
Julia Kreger
d4ddc213e9 Duplicate testing for system scoped ACL testing
In order for us to understand if we're starting to break
compatability with scope changes, we need to at least have
some testing, someway, some place to provide insight.

Hopefully, this should provide that insight by running
the same API testing we run with by default.

Once we have fully defined the scoped authenticaiton
use requirements, we can begin to build the new test
matrix, but this gives us a start.

Change-Id: Ie12e2665c97326142b564b23603647ec9d97052c
2021-02-11 10:35:16 -08:00
Steve Baker
606549c1c9 Populate existing policy tests
Testing every combination of role, endpoint and policy rule would
result in a huge test count, so to make testing the existing policy
rules complete and practical, the following guidelines are suggested:

- Only the default policy is tested, so inactive rules such as
  is_node_owner, is_node_lessee are ignored.
- Each rule is tested completely on one endpoint which uses it.
- A rule (such as baremetal:node:list) which inherits a parent rule
  (baremetal:node:get) is considered covered by the parent test.
- All endpoints need at least one test, but other endpoints which share
  a fully tested rule only need one denied test which shows that they
  are covered by some policy.

Also adds the initial pass of contributor documentation on how the
rbac testing works to try and express the mechanics and what to
expect to aid in reviewing/updating/editing the rules.

Co-Authored-By: Julia Kreger <juliaashleykreger@gmail.com>
Change-Id: I1cd88210e40e42f86464e6a817354620f5ab1d9c
2021-02-11 10:34:52 -08:00
Zuul
4e5c034187 Merge "Make boot_mode more consistent with other capabilities" 2021-02-11 14:24:31 +00:00
Dmitry Tantsur
189b5e40cd devstack: support installing ironic-lib from source in DIB IPA
Depends-On: https://review.opendev.org/c/openstack/ironic-python-agent-builder/+/775153
Change-Id: I8734776bf59b5a34327624184c1c2360ccda330a
2021-02-11 14:46:49 +01:00
Dmitry Tantsur
af4a7b0d9c Prepare 16.2 and clean up release note
Change-Id: I6e5f0e560f3f125a83e0514c10bee664c17663f2
2021-02-11 13:12:04 +01:00
Dmitry Tantsur
e36d7af097 Report the slowest tests after a test run
Change-Id: Id9cf476f56f2f78b9e8adf6e736148e91916777d
2021-02-11 12:44:32 +01:00
Jacob Anders
05df3d7aa4 Use OOB inspection to fetch MACs for IB inspection
This change adds get_mac_addresses call to the ManagementInterface which will
be used by both out-of-band inspection and in-band inspection with
ironic-inspector. This will remove the necessity of manually defining MAC
addresses for nodes and/or enabling IPMI functionality on Redfish-based
systems.

Change-Id: I3debcd1f32a2627dafd8456ec73a71fc7c402ebb
Story: 2008038
Task: 40699
2021-02-11 17:03:18 +10:00
Steve Baker
235115099a Generate policy.yaml.sample
Generating a yaml file called policy.json.sample is a bit misleading
because the file is not valid json, this change fixes that, with the
intention that the user can copy policy.yaml.sample to
/etc/ironic/policy.yaml and make customizations.

Change-Id: Ie6d5c8c38d785005d2bf2dc8f9f7ac42c2e8f7fb
2021-02-11 11:52:51 +13:00
vmud213
7d4c1214ff Add support to manage certificates in iLO
Adds methods to export and clear certificates on the node during node
provisioning. Also enables to implement clean/deploy steps for certificate
management through these APIs.

Change-Id: Idc86d7b78854e0618f62c7e4c1a88670dc4561b0
Story: #2008297
Task: #41182
2021-02-10 05:57:38 +00:00
Zuul
af29f398cc Merge "Don't mark an agent as alive if rebooted" 2021-02-08 09:24:47 +00:00