5320ecbaf2c0e77842ab1ee3eb8106948dc06704
Commit Graph

9055 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
Ade Lee
5320ecbaf2 replace md5 with swift utils version
md5 is not an approved algorithm in FIPS mode, and trying to
instantiate a hashlib.md5() will fail when the system is running in
FIPS mode.
md5 is allowed when in a non-security context. There is a plan to
add a keyword parameter (usedforsecurity) to hashlib.md5() to annotate
whether or not the instance is being used in a security context.
In the case where it is not, the instantiation of md5 will be allowed.
See https://bugs.python.org/issue9216 for more details.
Some downstream python versions already support this parameter. To
support these versions, a new encapsulation of md5() is added to
swift/common/utils.py. This encapsulation is identical to the one being
added to oslo.utils, but is recreated here to avoid adding a dependency.
This patch is to replace the instances of hashlib.md5() with this new
encapsulation, adding an annotation indicating whether the usage is
a security context or not.
While this patch seems large, it is really just the same change over and
again. Reviewers need to pay particular attention as to whether the
keyword parameter (usedforsecurity) is set correctly. Right now, all
of them appear to be not used in a security context.
Now that all the instances have been converted, we can update the bandit
run to look for these instances and ensure that new invocations do not
creep in.
With this latest patch, the functional and unit tests all pass
on a FIPS enabled system.
Co-Authored-By: Pete Zaitcev
Change-Id: Ibb4917da4c083e1e094156d748708b87387f2d87
2020年12月15日 09:52:55 -05:00
Zuul
36107b4a69 Merge "Give probe tests a second chance to pass" 2020年12月11日 12:57:39 +00:00
Zuul
f94959b836 Merge "Stop explicitly handling StopIteration in proxy-logging" 2020年12月10日 21:47:55 +00:00
Zuul
b6f312784f Merge "Increase gate timeouts from 1hr to 1.5hr" 2020年12月10日 20:10:32 +00:00
Zuul
442d7e22bb Merge "ssync: Tolerate more hang-ups" 2020年12月10日 09:52:50 +00:00
Zuul
165321f34e Merge "Fix invalid argument formatting in exception messages" 2020年12月09日 21:21:12 +00:00
Zuul
85d8409b34 Merge "ssync: don't log tracebacks for client disconnects" 2020年12月09日 12:19:04 +00:00
Zuul
13439edfb2 Merge "ratelimit: Log proper container path when returning 498 for listings" 2020年12月09日 08:48:10 +00:00
Zuul
5a76c082fe Merge "Stop invalidating suffixes post-SSYNC" 2020年12月09日 07:02:08 +00:00
Zuul
b4975d574d Merge "Have REPLICATE with suffixes just append to hashes.invalid" 2020年12月09日 04:57:45 +00:00
Tim Burke
b87bc7d18f Increase gate timeouts from 1hr to 1.5hr
Change-Id: I0a77025237549b192b6b695b6f18512dff28af6c
2020年12月08日 15:31:20 -08:00
Tim Burke
d4c0a7d3b3 Give probe tests a second chance to pass
...and bump up their timeout, since that seems more likely to happen if
we have to retry.
Change-Id: Ie05521f6cd146234dc5615c96ad19681b43e9110
2020年12月08日 15:24:20 -08:00
Zuul
fe1f1e8271 Merge "Give unit tests a second chance to pass" 2020年12月08日 08:27:54 +00:00
Tim Burke
232cb85cb9 Pin Bandit on py2
...and, since the previous tag didn't have the Bandit pin, make the
rolling upgrade job non-voting. We should plan on backporting this so we
can check that upgrades from stable branches are still OK.
See also: https://github.com/PyCQA/bandit/issues/654
Change-Id: If7f3ad8b275271d748426133232ed06c2a1cd1de
2020年12月07日 15:18:50 -08:00
Tim Burke
976cc8f482 Give unit tests a second chance to pass
Change-Id: I495fb1ec2394130c7274368662b58212ca375854
2020年12月04日 22:21:58 -08:00
Tim Burke
0d37492c65 Clean up requirements a bit
* Drop osc from test-requirements (and lower-constraints)
 I'm not clear on where/how we use it; I think it was a hold-over from
 swift3?
* Pin python-keystoneclient in our py2-constraints
 Something sees to have changed with the pip resolver that means it
 keeps trying to install a newer, py3-only version for our py2 jobs.
Change-Id: Ie37ac077517e1ece5fa6bf163d1ab5e316ced509
2020年12月01日 15:41:18 -08:00
Tim Burke
f54634e950 ssync: Tolerate more hang-ups
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Change-Id: I6e62f7cc0474087edfd7f0ca133c75dce71cc795
Closes-Bug: #1889951 
2020年11月24日 21:08:08 +00:00
Alistair Coles
155af38d1b ssync: don't log tracebacks for client disconnects
Previously a traceback was logged when the ssync receiver experienced
a problem reading the wsgi input. Now this is logged as an error but
without a traceback.
Change-Id: Ifadbe603d5fa5473397a32e14ae1b8023cb53eb2
Closes-Bug: #1889951 
2020年11月23日 17:37:00 +00:00
zhufl
cc94fb5b63 Fix invalid argument formatting in exception messages
This is to fix the invalid argument formatting in exception messages.
Change-Id: Ibce0db9fc75a07bbd6eb43ab1a412e6eb73fd27f
2020年11月20日 17:33:33 +08:00
Zuul
e22cad666a Merge "xlo: 5xx while validating first segment is a server error" 2020年11月20日 01:13:26 +00:00
Tim Burke
9c532891dc Stop explicitly handling StopIteration in proxy-logging
This used to be necessary when we were explicitly calling next() on the
app iter, but we don't need it any more.
Change-Id: I0ae13905443aa8c8a1941c3212d01c9a5ae674e6
Related-Change: I27feabe923a6520e983637a9c68a19ec7174a0df
2020年11月18日 11:46:03 -08:00
Zuul
0dc918e71a Merge "py2: Suppress more CryptographyDeprecationWarnings" 2020年11月18日 02:19:03 +00:00
Zuul
ebfc3a61fa Merge "Use socket_timeout kwarg instead of useless eventlet.wsgi.WRITE_TIMEOUT" 2020年11月18日 02:19:01 +00:00
Zuul
cd228fafad Merge "Add a new URL parameter to allow for async cleanup of SLO segments" 2020年11月18日 00:50:54 +00:00
Clay Gerrard
3d787ddff8 xlo: 5xx while validating first segment is a server error
With DLO and SLO, we validate that we can read the first segment before
sending data to the client; this helps catch auth errors where the user
has access to read the manifest but not the segments.
Sometimes, though, that validation fails for transient reasons; if the
proxy couldn't get enough responses from primaries to determine whether
the object exists (for example), we should send back a 503 to indicate
to the client that it should retry the request.
Change-Id: Ice5358ff85ee2d5fe60785b73b67dea493044a2c
2020年11月17日 16:38:33 +00:00
Tim Burke
3c3cab2645 Stop invalidating suffixes post-SSYNC
We only need the invalidation post-rsync, since rsync was changing data
on disk behind Swift's back. Move the REPLICATE call down into the
rsync() helper function and drop it from the reconstructor entirely.
Change-Id: I576901344f1f3abb33b52b36fde0b25b43e54c8a
Closes-Bug: #1818709 
2020年11月16日 08:30:07 -06:00
Tim Burke
5eaf15486e Have REPLICATE with suffixes just append to hashes.invalid
This only applies to post-sync REPLICATE calls, none of which actually
look at the response anyway.
Change-Id: I1de62140e7eb9a23152bb9fdb1fa0934e827bfda
2020年11月16日 08:21:16 -06:00
Zuul
6d988a4518 Merge "Dep's should be restricted by upper-constraints" 2020年11月14日 09:05:06 +00:00
Tim Burke
104afe56fa py2: Suppress more CryptographyDeprecationWarnings
Change-Id: Icdbebb55e85763a7bd2a269753ced61a99e557be
2020年11月13日 22:04:03 -08:00
Zuul
50d28dcfe9 Merge "gate: Add victoria rolling upgrade job" 2020年11月11日 23:52:06 +00:00
Tim Burke
918ab8543e Use socket_timeout kwarg instead of useless eventlet.wsgi.WRITE_TIMEOUT
No version of eventlet that I'm aware of hasany sort of support for
eventlet.wsgi.WRITE_TIMEOUT; I don't know why we've been setting that.
On the other hand, the socket_timeout argument for eventlet.wsgi.Server
has been supported for a while -- since 0.14 in 2013.
Drive-by: Fix up handling of sub-second client_timeouts.
Change-Id: I1dca3c3a51a83c9d5212ee5a0ad2ba1343c68cf9
Related-Change: I1d4d028ac5e864084a9b7537b140229cb235c7a3
Related-Change: I433c97df99193ec31c863038b9b6fd20bb3705b8
2020年11月11日 14:23:40 -08:00
Zuul
43216fa9a6 Merge "Fix a race condition in case of cross-replication" 2020年11月11日 21:24:49 +00:00
wu.shiming
ee641dffc9 Dep's should be restricted by upper-constraints
Tox trying to install latest versions for building docs which may
not be supported by stable and lower branches, so should be
restricted by respective version's upper-constraints.txt
Change-Id: I599d4ea430cc1e65bb50d0481617b005febf6de2
2020年11月11日 18:30:27 +08:00
Tim Burke
e78377624a Add a new URL parameter to allow for async cleanup of SLO segments
Add a new config option to SLO, allow_async_delete, to allow operators
to opt-in to this new behavior. If their expirer queues get out of hand,
they can always turn it back off.
If the option is disabled, handle the delete inline; this matches the
behavior of old Swift.
Only allow an async delete if all segments are in the same container and
none are nested SLOs, that way we only have two auth checks to make.
Have s3api try to use this new mode if the data seems to have been
uploaded via S3 (since it should be safe to assume that the above
criteria are met).
Drive-by: Allow the expirer queue and swift-container-deleter to use
high-precision timestamps.
Change-Id: I0bbe1ccd06776ef3e23438b40d8fb9a7c2de8921
2020年11月10日 18:22:01 +00:00
Tim Burke
711fb302b8 gate: Add victoria rolling upgrade job
Change-Id: I6ca407b86658191b2db1e806d284cdd6348c86e1
2020年11月09日 13:25:19 -08:00
Tim Burke
90c737e355 Use swiftclient Connections in sharding probe tests
This gets us retries "for free" and should reduce gate flakiness.
Change-Id: Ia2e4c94f246230a3e25e4557b4b2c1a3a67df756
2020年11月09日 10:55:15 -08:00
Zuul
2b79d0befd Merge "tests: Increase container-update timeouts for rolling upgrade jobs" 2020年11月09日 11:39:56 +00:00
Zuul
d5618f10ca Merge "Move config option documentation to separate docs" 2020年11月07日 01:32:40 +00:00
Zuul
2593f7f264 Merge "memcache: Make error-limiting values configurable" 2020年11月07日 01:32:38 +00:00
Zuul
506dd139dc Merge "Remove the unused coding style modules" 2020年11月06日 23:42:04 +00:00
Tim Burke
24060f6e62 tests: Increase container-update timeouts for rolling upgrade jobs
This should help make tests that rely on up-to-date listings more reliable.
Change-Id: Ib888c84fa629cc78f48a8251eda98c0fa51242c0
2020年11月06日 13:33:02 -08:00
Zuul
ae9c08c2ee Merge "Increase container_update_timeout in in-process func tests" 2020年11月06日 20:48:01 +00:00
Zuul
f953bc0d49 Merge "Refactor audit shard tests" 2020年11月06日 02:37:15 +00:00
Zuul
22c778412a Merge "Add librsvg2-* to bindep.txt" 2020年11月06日 01:43:09 +00:00
Tim Burke
05d8b8fba1 Increase container_update_timeout in in-process func tests
This should make us less likely to fail in the gate because of listing
consistency issues.
Drive-by: Remove the allowed_headers override; that hasn't been necessary
since we updated the default value a while back.
Change-Id: Id280bc93ed6e899a62b0115fdf144a564ef0cd8d
Related-Change: Ib82e175096716e42aecdab48f01f079e09da6a1d
2020年11月05日 17:42:05 -08:00
Zuul
622bae72f1 Merge "Continue logging deprecation warnings for run_pause" 2020年11月06日 00:24:34 +00:00
Tim Burke
aff65242ff memcache: Make error-limiting values configurable
Previously these were all hardcoded; let operators tweak them as needed.
Significantly, this also allows operators to disable error-limiting
entirely, which may be a useful protection in case proxies are
configured with a single memcached server.
Use error_suppression_limit and error_suppression_interval to mirror the
option names used by the proxy-server to ratelimit backend Swift
servers.
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: Ife005cb8545dd966d7b0e34e5496a0354c003881
2020年11月05日 23:37:24 +00:00
Tim Burke
2b1eec79f6 Continue logging deprecation warnings for run_pause
...even after the operator has configured interval. This was raised
during the Oct 2020 ops feedback session.
Change-Id: Ie44de8f15df63813367b76e1b96be456fac9b2b0
2020年11月05日 22:15:57 +00:00
Alistair Coles
72786533ea Move config option documentation to separate docs
This patch moves the tables describing configuration options for each
server type from the deployment_guide.rst doc to separate per-server
documents. The new per-server documents are grouped under a config
directory with a config index doc. The config index doc is listed in
the top level index and provides a single starting point to navigate
to the individual server docs.
Change-Id: I6cedd98586febb5dc949c088ee44e160385ed324
2020年11月05日 14:40:05 +00:00
Alistair Coles
f4ce322776 Add librsvg2-* to bindep.txt
Add the librsvg2-* package to bindep.txt. This package has been
required to build docs since the Related-Change. The package is added
to a new 'doc' profile in bindep.txt; if missing, the package will be
reported by:
 bindep doc
The 'doc' profile is added to the tox 'bindep' env command so that, if
missing, the package will always be reported by:
 tox -e bindep
Change-Id: I6c60c31ca8002133ab77f05f59359b25315b299c
Related-Change: I26cefda80d3234df68d7152b404e0a71da74ab90
Closes-Bug: 1903038
2020年11月05日 12:13:52 +00:00