Commit Graph

6348 Commits

Author SHA1 Message Date
Zuul ebdccfab58 Merge "Enable Bandit testing in Manila" 2024-05-23 21:47:44 +00:00
Zuul 4109b81f21 Merge "Applies nosec in Dell EMC eNAS" 2024-05-23 21:44:48 +00:00
Zuul dbfb40c9f1 Merge "Fixes for Bandit Issues in Nexenta Drivers" 2024-05-23 21:41:25 +00:00
Zuul b415ce83ac Merge "[NetApp] Pause and resume clone split during rename snapshot" 2024-05-21 21:23:20 +00:00
Zuul 45268b6a58 Merge "RBAC: Enable "new" defaults and scope checks" 2024-05-21 03:58:19 +00:00
Zuul 63e54f91e0 Merge "api: Add schemas for resource_locks" 2024-05-20 16:17:24 +00:00
Kiran Pawar 7bcf51e962 [NetApp] Pause and resume clone split during rename snapshot
When snpashot are soft deleted i.e. they are renamed if delete fails,
sometime we face issue in rename operation. This is due to busy
snapshot clone split operations. So perform rename and then start clone
split.

Closes-bug: #2025641
Change-Id: I1093a610f31f5971bb23b9f89c64f5f129ac2fb9
2024-05-20 13:09:23 +00:00
Zuul 14a60ba229 Merge "[CI] Grenade job changes for 2024.2 release cycle" 2024-05-17 22:31:30 +00:00
Stephen Finucane 9be7243e70 api: Add schemas for resource_locks
This is a mostly complete example showing request body, request query
string and response body schemas in action. The only thing not included
yet is descriptions for fields, which is still being worked on.

Change-Id: I14db582eec6db25ea5437675f8207dcf94228b25
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Partially-implements: bp json-schema-validation
2024-05-17 21:16:51 +00:00
Zuul 328d957063 Merge "Use config validation to reject invalid max_over_subscription_ratio" 2024-05-16 02:06:44 +00:00
Goutham Pacha Ravi 05279a6fe7 [CI] Grenade job changes for 2024.2 release cycle
We're in a non-SLURP release cycle; this means that we'd test upgrading to
the release produced by this cycle is supported only from stable/2024.1 (Caracal).

So set "grenade_from_branch" to stable/2024.1 and run only the "skip-level"
grenade job. When we get into the 2025.1 cycle, we can run the regular
grenade job as well.

Change-Id: If17ddd1bc06810d94db43dec3bb877d5045621ad
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2024-05-15 21:47:36 +00:00
Ubuntu d9dd70c4f4 Applies nosec in Dell EMC eNAS
Bandit raises a flag at evals, suggests using
literal_eval which does not work here.

Instead of using eval to parse the attributes,
should use getattr method instead.
When using getattr, unit tests fail
because of problems with mocking requests.
Applying nosec and reported a bug.

Related-Bug: 2065727
Change-Id: Ib5404d9e165be5879f5351c3f0952648ae702b2d
2024-05-15 19:10:06 +00:00
Zuul 1cd1c4369f Merge "Specify bandit rule to nosec in ZFSSA driver" 2024-05-14 04:40:45 +00:00
Ashley Rodriguez cad3158566 Specify bandit rule to nosec in ZFSSA driver
Adds specific rule to no sec comment for ZFSSA driver.
Follow up to change Id71c0ee4138b695ff19085a284ccced6b1a9dbba

Depends-On: I532ff3f0b2613340e0cb46c3b7e57a22cfa50c61
Change-Id: I997d45d3d3850af30510af41ef335242f02642fc
2024-05-13 19:44:41 +00:00
Ubuntu 67f95a49e1 Fixes for Bandit Issues in Nexenta Drivers
Adds a timeout to a post so Bandit
stops crying. Adds a nosec comment to
an MD5 hash because I can't tell if it's
used for security or not.

Change-Id: I46ad1a7ca723157488525ca7239cbd0ef421b975
2024-05-13 15:44:39 +00:00
Zuul ef96aed30f Merge "Adds nosec comments to Ganesha drivers" 2024-05-13 02:13:23 +00:00
Zuul ff9453cbf3 Merge "Replace deprecated xml.etree.cElementTree" 2024-05-11 02:16:35 +00:00
Zuul 1e0ef4aa00 Merge "api: Add validation middleware" 2024-05-10 06:09:44 +00:00
Stephen Finucane 44dedee9f3 api: Add validation middleware
This is mostly a copy-paste from Nova (which was also copied to Cinder).
It should probably live in oslo.service or elsewhere, but for now we
vendor the code here. The main change is that we use the Draft 2020-12
schema rather than the Draft 4 schemes currently used elsewhere (though
those will be changing too).

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I76285d95bd7b9a6489c7839220fc941f1acdc263
Partially-implements: bp json-schema-validation
2024-05-10 03:12:41 +00:00
Ashley Rodriguez 33034100ed QNAP bandit follow up
Adds correct rule to nosec in QNAP driver
Follow up to change I171c90a281c7b62c2601131293f9f00a926641e2

Change-Id: Ice0621cd20345cea04539588bdadc93ad6a15a15
2024-05-09 12:27:05 -04:00
Zuul 433e99519f Merge "Refactor mockup file load" 2024-05-08 21:22:30 +00:00
Takashi Kajinami 571d67a8d9 Refactor mockup file load
Use low-level os.path function + __file__ which are already used in
the other places.

Also consistency use os.path.join to compose file paths instead of
bare +, to avoid confusions about trailing / .

Change-Id: I1363e4befe41f3bb63b66b2589011e51828bcbbe
2024-05-08 03:16:22 +00:00
Zuul a9d0f30869 Merge "Optimize deferred deletion share instance get query" 2024-05-08 02:29:40 +00:00
Takashi Kajinami e047b428a5 Replace deprecated xml.etree.cElementTree
cElementTree was deprecated in Python 3.3 .

Use defusedxml instead of the built-in xml module to avoid potentially
malicious operation[1].

[1] https://docs.python.org/3/library/xml.html#xml-vulnerabilities

Change-Id: I7b2d2843fb82873e6194c040c6cdfd515de2cefe
2024-05-08 01:07:48 +00:00
Zuul 7a75af9653 Merge "Replaces qnap driver XML with defusedxml" 2024-05-07 20:02:50 +00:00
Zuul dfc334a82e Merge "Remove logic for Python 2 compatibility" 2024-05-07 17:34:08 +00:00
Takashi Kajinami 224e304e8c Remove logic for Python 2 compatibility
The collections module should/can be always used in Python 3.

Change-Id: Iccc028f15078a3e197eb2aedde8e289102bf6d74
2024-05-07 21:16:25 +09:00
Takashi Kajinami b6d7129a53 Remove fallback for Python 2
Python 2 is no longer supported, thus fallback to urllib2 is no longer
used.

Change-Id: I68d769f140d7114b12344c6d69974affdb7badaf
2024-05-07 21:14:02 +09:00
Kiran Pawar fab04b5751 Optimize deferred deletion share instance get query
The periodic database queries made by the share manager service to
process deferred deletion of shares has been fixed to consider the
host in addition to the share's state. This both improves performance
of the periodic task, as well as fixes incorrect behavior where
incorrect shares are retrieved by the query.

Partially-implements: bp/deferred-deletion
Change-Id: I813a3130ae015a6b8778bb2a288075b949313c73
2024-05-07 08:51:20 +00:00
Zuul 842fda18e5 Merge "Remove old excludes" 2024-05-06 02:25:25 +00:00
Zuul 0f5766bd0e Merge "Adds usedforsecurity=False to NetApp ONTAP MD5 hashes" 2024-05-03 20:02:10 +00:00
Takashi Kajinami cf94931d9b Remove old excludes
These are detected as errors since the clean up was done[1] in
the requirements repository. Minimum versions are bumped to avoid
installing known bad versions.

[1] 314734e938f107cbd5ebcc7af4d9167c11347406

Change-Id: I9ce84c193903b36109bc81c08bd760a50bbfd473
2024-05-01 11:20:23 +09:00
Zuul 242dc78ee5 Merge "Adds nosec comment to ZFSSA driver" 2024-05-01 00:55:07 +00:00
Ubuntu 333e6aee90 Enable Bandit testing in Manila
Adds a Bandit testing environment to the tox.ini file and
adds a job to project.yaml Zuul CI file to run the Bandit
test environment. Also includes a nosec comment to ignore
a hardbinding to 0.0.0.0 in service.py

Depends-On: I78a5b708cd970dcb60f480d8e6a201d0768645fc
Depends-On: I27d1204ec7dafd3b578d1261c3fd2e371ae405fb
Depends-On: I2a913f3b87e16554b1bd68543fcf254cc4226031
Depends-On: I46ad1a7ca723157488525ca7239cbd0ef421b975
Depends-On: Ib5404d9e165be5879f5351c3f0952648ae702b2d
Depends-On: Id71c0ee4138b695ff19085a284ccced6b1a9dbba
Depends-On: I33bbb7070ada5509ca05c90d7a38077d38f54a1f
Depends-On: I3e974a2113b29af1111f27ca1afeb78091a0ec75
Depends-On: I0e686c91ce02ea42719d00d17f6ed659e97470ac
Depends-On: I171c90a281c7b62c2601131293f9f00a926641e2

Change-Id: I8eb93cdcd5d47a6a5495ee7277c72d5f028cb412
2024-04-30 18:22:10 +00:00
Elvis Acheampong 05c9446bd9 Replaces qnap driver XML with defusedxml
Replaces qnap driver's use of Python's
Standard XML library methods with defusedxml's
methods instead.The defusedXML protects the app
from XML attacks.
Instructed bandit to skip the line 86 of api.py
of qnap driver. _create_unverified_context was
intentionally used by developer which bandit
wasn't happy about.

Change-Id: I171c90a281c7b62c2601131293f9f00a926641e2
2024-04-30 17:44:59 +00:00
Zuul 57ca67ab76 Merge "Ensure password values are not logged" 2024-04-30 08:01:44 +00:00
Zuul 7250b84839 Merge "Adds usedforsecurity=False to HPE 3PAR driver" 2024-04-29 21:34:22 +00:00
Zuul 0b4673e81f Merge "Adds timeouts to Quobyte driver file" 2024-04-29 20:53:45 +00:00
Zuul 6478105f0d Merge "Replaces Huawei driver XML with defusedxml" 2024-04-29 20:53:43 +00:00
Zuul 68d3bf75fc Merge "Adds "usedforsecurity=False" to veritas drivers" 2024-04-29 20:53:41 +00:00
Zuul 6175390f18 Merge "[DOC] Add subnet metadata to user guide" 2024-04-26 18:13:12 +00:00
Zuul 2c95d47b97 Merge "Check share network for share groups before deletion" 2024-04-24 01:25:30 +00:00
Ubuntu 2808f3e1fe Adds nosec comments to Ganesha drivers
Bandit is yelling about possible SQL injection
because an SQL command is being amended, but
it's being amended onto a blank string so I
do not think this is a security issue. Also,
Bandit is yelling about 0.0.0.0 being binded
but this is intentional and will break stuff
if changed.

Change-Id: I3e974a2113b29af1111f27ca1afeb78091a0ec75
2024-04-23 17:09:50 +00:00
Ubuntu 3a958c78c0 Adds usedforsecurity=False to NetApp ONTAP MD5 hashes
Bandit is yelling but these aren't used for security
purposes, I think, so this will sort out Bandit

Change-Id: I0e686c91ce02ea42719d00d17f6ed659e97470ac
2024-04-23 17:07:02 +00:00
Zuul d0b5bdab06 Merge "[doc] Quota paramaters have moved to the [quota] section" 2024-04-22 21:26:43 +00:00
Takashi Kajinami f8a53c037a Ensure password values are not logged
Make sure that all password options is defined with secret=True so that
the given values do not appear in debug logs.

Also remove the redundant default=None .

Change-Id: I989e825ef160a65a5a72c58d6fd4e8099044bcd5
2024-04-22 15:36:26 +09:00
Elvis Acheampong 674c9c9e19 Adds "usedforsecurity=False" to veritas drivers
The purpose of md5 was not specified.
Veritas drivers use mds hashes which pop on bandit as security issues
Putting "usedforsecurity=False" properly shows the hash function
is not use for security.

Change-Id: I78a5b708cd970dcb60f480d8e6a201d0768645fc
2024-04-18 14:38:27 +00:00
Goutham Pacha Ravi b269c140a7 RBAC: Enable "new" defaults and scope checks
Enable new defaults and scope checks by default
As discussed in PTG, we need to test the new RBAC
and accordingly enable the new defaults
and scope check by default.

Change-Id: I02a2b7e9296e3034d7c20656a12cbdb2cb7a3182
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2024-04-17 19:29:24 -07:00
Ubuntu 32ac176053 Adds timeouts to Quobyte driver file
To appease Bandit, timeouts have to be
everywhere. So here are some timeouts
so Bandit stops crying.

Change-Id: I2a913f3b87e16554b1bd68543fcf254cc4226031
2024-04-15 22:27:20 +00:00
Ubuntu e47c6c2611 Adds usedforsecurity=False to HPE 3PAR driver
To appease Bandit since SHA1 angers
the beast, usedforsecurity=False will be
bolted to the hash function

Change-Id: I33bbb7070ada5509ca05c90d7a38077d38f54a1f
2024-04-11 20:04:58 +00:00