4890 Commits

Author SHA1 Message Date
Romain LE DISEZ
71f6fd025e Allows to configure the rsync modules where the replicators will send data
Currently, the rsync module where the replicators send data is static. It
forbids administrators to set rsync configuration based on their current
deployment or needs.

As an example, the rsyncd configuration example encourages to set a connections
limit for the modules account, container and object. It permits to protect
devices from excessives parallels connections, because it would impact
performances.

On a server with many devices, it is tempting to increase this number
proportionally, but nothing guarantees that the distribution of the connections
will be balanced. In the worst scenario, a single device can receive all the
connections, which is a severe impact on performances.

This commit adds a new option named 'rsync_module' to the *-replicator sections
of the *-server configuration file. This configuration variable can be
extrapolated with device attributes like ip, port, device, zone, ... by using
the format {NAME}. eg:
    rsync_module = {replication_ip}::object_{device}

With this configuration, an administrators can solve the problem of connections
distribution by creating one module per device in rsyncd configuration.

The default values are backward compatible:
    {replication_ip}::account
    {replication_ip}::container
    {replication_ip}::object

Option vm_test_mode is deprecated by this commit, but backward compatibility is
maintained. The option is only effective when rsync_module is not set. In that
case, {replication_port} is appended to the default value of rsync_module.

Change-Id: Iad91df50dadbe96c921181797799b4444323ce2e
2015-09-07 08:00:18 +02:00
Jenkins
bddfc521d8 Merge "Replace a / b with a // b to use integer division where needed" 2015-09-03 21:26:01 +00:00
Jenkins
e1cf4f4f2a Merge "[Labs] Update links to Cloud Admin Guide" 2015-09-03 13:45:18 +00:00
Jenkins
bbbef0e5a6 Merge "Test if container_sweep is executed on unmounted devices" 2015-09-03 02:24:10 +00:00
Jenkins
4d4b8fcacd Merge "Add unit test for container_update for unmounted device" 2015-09-03 02:22:11 +00:00
Jenkins
12f03df636 Merge "Add test that a tempurl POST cannot set a DLO manifest header" 2015-09-03 01:18:05 +00:00
Emett Speer
e4542455c8 [Labs] Update links to Cloud Admin Guide
Update links to the Cloud Admin Guide after the
RST conversion of that book altered URLs.

Change-Id: I899f8938498b744e62887968a65e58c00ef27f1b
2015-09-02 17:42:31 -07:00
Jenkins
0baaea66d7 Merge "Adds useful dispersion info from changelog" 2015-09-02 23:14:11 +00:00
Jenkins
21967718b6 Merge "Preserve traceback in swift-dispersion-report" 2015-09-02 12:27:46 +00:00
Jenkins
e6bd65682f Merge "Fix EC range GET/COPY handling" 2015-09-02 12:27:42 +00:00
Jenkins
84e91e0064 Merge "Included reference in swift.obj.diskfile to enumerate the string used for data file paths." 2015-09-02 12:27:23 +00:00
Jenkins
a22c942a54 Merge "Fix dispersion-reports error message" 2015-09-02 11:12:29 +00:00
Christian Schwede
58fcc07523 Test if container_sweep is executed on unmounted devices
This change ensures that container_sweep is not run if a device is not mounted
and mount_check is set to True.

Change-Id: I823083c8431d9e61fd426508033ec9188503957b
2015-09-02 10:53:09 +00:00
Jenkins
83c4e63dbb Merge "eventlet.posthook related code needn't anymore" 2015-09-02 08:13:08 +00:00
Jenkins
df20b794c0 Merge "EC GET path: require fragments to be of same set" 2015-09-02 06:12:46 +00:00
Samuel Merritt
e02609c66a Preserve traceback in swift-dispersion-report
Commit c690bcb fixed a bug in the dispersion report, but changed this
from a bare "raise" to "raise err", which loses the traceback. Not a
big deal, but worth putting back IMO.

Change-Id: Id5b72153a4b8df8e3faaf1fa3fb2040e28ba85cc
2015-09-01 15:19:50 -07:00
Minwoo Bae
d06d4ad0fd Included reference in swift.obj.diskfile to enumerate the string
used for data file paths.

Change-Id: Ie22caa678bc00dfc43fabec7efbbb9f34490f1b5
2015-09-01 15:11:25 -05:00
Brian Cline
615c7a204b Adds useful dispersion info from changelog
Change-Id: I1a45088fc32620b02ff9a754b02ec1eb75a59d6e
2015-09-01 10:51:20 -05:00
Jenkins
cde92d98dc Merge "Make ssync_sender send valid chunked requests" 2015-09-01 08:26:58 +00:00
Jenkins
d077b0cd81 Merge "Remove duplicate X-Backend-Storage-Policy-Index key" 2015-09-01 08:19:39 +00:00
Jenkins
51819f1179 Merge "Updated CHANGELOG, AUTHORS, and .mailmap for 2.4.0 release." 2015-09-01 04:19:44 +00:00
janonymous
3b8755098a Replace a / b with a // b to use integer division where needed
Change-Id: I72c81faa62786e140b0de00e3a04934bf1b5adbd
2015-09-01 07:07:09 +05:30
John Dickinson
524c89b7ee Updated CHANGELOG, AUTHORS, and .mailmap for 2.4.0 release.
Change-Id: Ic6301146b839c9921bb85c4f4c1e585c9ab66661
2015-08-31 10:53:01 -07:00
Jenkins
ec800bc534 Merge "Fix EC GET backend stream iteration state" 2015-08-31 12:05:08 +00:00
Clay Gerrard
05de1305a9 Make ssync_sender send valid chunked requests
The connect method of ssync_sender tells the remote connection that it's
going to send a valid HTTP chunked request, but if the remote end needs
to respond with an error of any kind sender throws HTTP right out the
window, picks up his ball, and closes the socket down hard - much to the
surprise of the eventlet.wsgi server who up to this point had been
playing along quite nicely with this 'SSYNC' nonsense assuming that
everyone here is consenting mature adults.

If you're going to make a "Transfer-Encoding: chunked" request have the
good decency to finish the job with a proper '0\r\n\r\n'. [1]

N.B. It might be possible to handle an error status during the
initialize_request phase with some sort of 100-continue support, but
honestly it's not entirely clear to me when the server isn't going to
close the connection if the client is still expected to send the body
[2] - further if the error comes later during missing_check or updates
we'll for sure want to send the chunk transfer termination line before
we close down the socket and this way we cover both.

1. Really, eventlet.wsgi shouldn't be so blasted brittle about this [3]
2. https://lists.w3.org/Archives/Public/ietf-http-wg/2005AprJun/0007.html
3. c3ce3eef0b

Closes-Bug #1489587
Change-Id: Ic17c6c3075553f8cf6ef6213e62a00282f0d01cf
2015-08-28 11:38:05 -07:00
nakagawamsa
993ee4e37a Remove duplicate X-Backend-Storage-Policy-Index key
There is duplicate 'X-Backend-Storage-Policy-Index' dictionary key in unit.obj.test_server.py.
One key has fixed policy index value, and another has random value.
Unittest should done with random policy index, so remove key which is set fixed value.

Change-Id: Ic91fcf44d48297d0feee33c928ca682def9790a3
2015-08-28 06:54:06 +00:00
paul luse
893f30c61d EC GET path: require fragments to be of same set
And if they are not, exhaust the node iter to go get more.  The
problem without this implementation is a simple overwrite where
a GET follows before the handoff has put the newer obj back on
the 'alive again' node such that the proxy gets n-1 fragments
of the newest set and 1 of the older.

This patch bucketizes the fragments by etag and if it doesn't
have enough continues to exhaust the node iterator until it
has a large enough matching set.

Change-Id: Ib710a133ce1be278365067fd0d6610d80f1f7372
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Co-Authored-By: Alistair Coles <alistair.coles@hp.com>
Closes-Bug: 1457691
2015-08-27 21:09:41 -07:00
Jenkins
bb5e38569e Merge "Restrict PyECLib version to 1.0.7" 2015-08-28 00:57:52 +00:00
Jenkins
59550070f9 Merge "Better scoping for tempurls, especially container tempurls" 2015-08-27 10:28:35 +00:00
Jenkins
fb79ffc9e6 Merge "Disallow unsafe tempurl operations to point to unauthorized data" 2015-08-27 10:26:26 +00:00
Jenkins
f0af259aae Merge "pep8: Don't override '_' symbol" 2015-08-26 19:51:54 +00:00
Alistair Coles
58a10a5fff Add test that a tempurl POST cannot set a DLO manifest header
Follow up to [1] to add tests for tempurl POSTs not being allowed
to set a DLO manifest header.

[1] I11e68830009d3f6bff44ae4011a41b67139146f6

Change-Id: I7c0ad5a936f71e56c599b8495a586913d3334422
Related-Bug: 1453948
2015-08-26 16:30:23 +01:00
Samuel Merritt
d4409c0a04 Better scoping for tempurls, especially container tempurls
It used to be that a GET of a tempurl referencing a large object would
let you download that large object regardless of where its segments
lived. However, this led to some violated user expectations around
container tempurls.

(Note on shorthand: all tempurls reference objects. However, "account
tempurl" and "container tempurl" are shorthand meaning tempurls
generated using a key on the account or container, respectively.)

Let's say an application is given tempurl keys to a particular
container, and it does all its work therein using those keys. The user
expects that, if the application is compromised, then the attacker
only gains access to the "compromised-container". However, with the old
behavior, the attacker could read data from *any* container like so:

1) Choose a "victim-container" to download

2) Create PUT and GET tempurl for any object name within the
   "compromised-container". The object doesn't need to exist;
   we'll create it.

3) Using the PUT tempurl, upload a DLO manifest with
   "X-Object-Manifest: /victim-container/"

4) Using the GET tempurl, download the object created in step 3. The
   result will be the concatenation of all objects in the
   "victim-container".

Step 3 need not be for all objects in the "victim-container"; for
example, a value "X-Object-Manifest: /victim-container/abc" would only
be the concatenation of all objects whose names begin with "abc". By
probing for object names in this way, individual objects may be found
and extracted.

A similar bug would exist for manifests referencing other accounts
except that neither the X-Object-Manifest (DLO) nor the JSON manifest
document (SLO) have a way of specifying a different account.

This change makes it so that a container tempurl only grants access to
objects within its container, *including* large-object segments. This
breaks backward compatibility for container tempurls that may have
pointed to cross container *LO's, but (a) there are security
implications, and (b) container tempurls are a relatively new feature.

This works by having the tempurl middleware install an authorization
callback ('swift.authorize' in the WSGI environment) that limits the
scope of any requests to the account or container from which the key
came.

This requires swift.authorize to persist for both the manifest request
and all segment requests; this is done by having the proxy server
restore it to the WSGI environment prior to returning from __call__.

[CVE-2015-5223]

Co-Authored-By: Clay Gerrard <clayg@swiftstack.com>
Co-Authored-By: Alistair Coles <alistair.coles@hp.com>
Co-Authored-By: Christian Schwede <cschwede@redhat.com>
Co-Authored-By: Matthew Oliver <matt@oliver.net.au>

Change-Id: Ie6d52f7a07e87f6fec21ed8b0ec1d84be8b2b11c
Closes-Bug: 1449212
2015-08-26 08:06:57 -07:00
Clay Gerrard
10b2939b43 Disallow unsafe tempurl operations to point to unauthorized data
Do not allow PUT tempurls to create pointers to other data. Specifically
disallow the creation of DLO object manifests by returning an error if a
non-safe tempurl request includes an X-Object-Manifest header regardless of
the value of the header.

This prevents discoverability attacks which can use any PUT tempurl to probe
for private data by creating a DLO object manifest and then using the PUT
tempurl to head the object which would 404 if the prefix does not match any
object data or form a valid DLO HEAD response if it does.

This also prevents a tricky and potentially unexpected consequence of PUT
tempurls which would make it unsafe to allow a user to download objects
created by tempurl (even if they just created them) because the result of
reading the object created via tempurl may not be the data which was uploaded.

[CVE-2015-5223]

Co-Authored-By: Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>

Change-Id: I11e68830009d3f6bff44ae4011a41b67139146f6
Closes-Bug: 1453948
2015-08-26 08:06:52 -07:00
Jenkins
ff7eb0c6d5 Merge "Allow pep8 of a single file" 2015-08-26 08:11:57 +00:00
Jenkins
bfcda54749 Merge "Fix swob.Range docstring" 2015-08-26 07:48:27 +00:00
Jenkins
f3e3c85289 Merge "Fix the comment in [1]." 2015-08-26 03:11:46 +00:00
Kazuhiro MIYAHARA
c690bcb683 Fix dispersion-reports error message
This patch fixes Swift to show message
"No objects to query. Has swift-dispersion-populate been run?"
for "swift-dispersion-report —object-only”
with no container for object dispersion.

Change-Id: I82da56709cfc296a27f5180681709bc56adbc13d
Closes-Bug: #1468120
2015-08-26 11:32:06 +09:00
Jenkins
462aad2a24 Merge "test/(functional/probe):Replace python print operator with print function (pep H233, py33)" 2015-08-25 21:43:12 +00:00
Jenkins
e354f897c3 Merge "Add container sync probe test to SAIO default set" 2015-08-25 20:25:01 +00:00
Tushar Gohad
8086a0e534 Restrict PyECLib version to 1.0.7
v1.0.9 rev of PyECLib replaces Jerasure with a native EC
implementation (liberasurecode_rs_vand) as the default
EC scheme.  Going forward, Jerasure will not be bundled
with PyPI version of PyECLib as it used to be, until
v1.0.7.

This is an interim change to Swift requirements until we
get v1.0.9 PyECLib included into global-requirements and
ready patches that change Swift default ec_type (for doc,
config samples and unit tests) from "jerasure_rs_vand"
to "liberasurecode_rs_vand."

Change-Id: Ica4fee2cdea2bc7f5edd0e51ad637a4457faf3b4
2015-08-25 17:07:37 +00:00
Kota Tsuyuzaki
17efa343c6 Fix EC GET backend stream iteration state
In EC case, When GET object requested, proxy-server always makes a log
line "Client disconnected on read" even though the request succeeded.

That is because ECAppIter class doesn't maintain a bunch of backend
stream when closing the app_iter. It will cause unfortunately
GeneratorExit on backend stream ResumingGetter.

This patch fixes to set non_client_disconnected to propagate the state
to the backend streams when the range iteration stopped successful.

Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>

Change-Id: I77af9807816bea1444d66534a17e2a210bcf09f8
Closes-Bug: #1472201
2015-08-25 08:03:34 -07:00
Jenkins
daf448f490 Merge "Fix 500 for bogus Range request to 0-byte object." 2015-08-25 13:07:57 +00:00
Jenkins
90a1d650b6 Merge "pep8: Fix usage of the l10n _('...') function" 2015-08-25 11:04:08 +00:00
Jenkins
ca172887a6 Merge "Fix use of delimiter in account listings" 2015-08-25 11:03:59 +00:00
Jenkins
f7c235513c Merge "Follow up patch to fix a multiline import NITPIC" 2015-08-25 10:28:47 +00:00
Alistair Coles
25dc7224b6 Fix swob.Range docstring
Bad ranges cause a ValueError to be raised, not an empty
ranges list.

Change-Id: I118bd2f7dc08ff5198870f4093c6eb350506c8ed
2015-08-25 11:05:41 +01:00
Jenkins
d703a532cb Merge "Use correct Storage-Policy header for REPLICATE requests" 2015-08-25 08:30:57 +00:00
Jenkins
75664055b2 Merge "Minor cleanup handoff mode warnings" 2015-08-25 08:11:00 +00:00
Jenkins
e8b0461a34 Merge "New troubleshooting case in documentation." 2015-08-25 08:10:55 +00:00