<br><br><div class="gmail_quote">On Wed, Mar 13, 2013 at 3:05 PM, Edward Shishkin <span dir="ltr">&lt;<a href="mailto:edward@redhat.com" target="_blank">edward@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Dear all,<br>
<br>
This requires openssl of version &gt;= 1.0.1c<br>
<br>
Is it possible to upgrade the openssl on the machines, which<br>
perform smoke tests? Any ideas? I can provide the instructions..<br>
<br>
I hope this feature will be useful and popular.<br>
<br>
Thanks,<br>
Edward.<br>
<div><div class="h5"><br></div></div></blockquote><div><br></div><div>Thanks for posting the patches! Can you give a quick summary of what 1.0.1c features are being used in the translator? Is it possible to re-implement some code to depend on openssl-1.0.0? The build system is CentOS 6.3 (~= RHEL 6.3) - which is a very popular &quot;base&quot; for deploying glusterfs. I suspect depending on 1.0.1c openssl will be more than just a &quot;build server dependency&quot; issue.</div>
<div><br></div><div>Avati</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
On Wed, 13 Mar 2013 17:25:41 -0400 (EDT)<br>
John Mark Walker &lt;<a href="mailto:johnmark@redhat.com">johnmark@redhat.com</a>&gt; wrote:<br>
<br>
&gt; This marks an interesting development in GlusterFS. If you&#39;ve been<br>
&gt; looking for data encryption, you may want to try this patch.<br>
&gt;<br>
&gt; -JM<br>
&gt;<br>
&gt;<br>
&gt; -------- Original Message --------<br>
&gt; Subject: Change in glusterfs[master]:      Transparent data<br>
&gt; encryption and metadata authentication... From: &quot;Edward Shishkin<br>
&gt; (Code Review)&quot; &lt;<a href="mailto:root@dev.gluster.com">root@dev.gluster.com</a>&gt; To:<br>
&gt; CC:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Edward Shishkin has uploaded a new change for review.<br>
&gt;<br>
&gt; Change subject:      Transparent data encryption and metadata<br>
&gt; authentication              in the systems with non-trusted<br>
&gt; server ......................................................................<br>
&gt;<br>
&gt; Transparent data encryption and metadata authentication<br>
&gt;              in the systems with non-trusted server<br>
&gt;<br>
&gt; This new functionality can be useful in various cloud technologies.<br>
&gt; It is implemented via a pair of the following interacting translators:<br>
&gt;<br>
&gt; . encryption/crypt, which works on client side and performs encryption<br>
&gt;   and authentication;<br>
&gt; . features/oplock, which works on server side and resolves &quot;conflicts&quot;<br>
&gt;<br>
&gt;             1. The class of algorithms for data encryption,<br>
&gt;            that can be supported by this pair of translators<br>
&gt;<br>
&gt; The mentioned pair of translators can support any atomic symmetric<br>
&gt; block cipher algorithms (which require to pad plain/cipher text before<br>
&gt; performing encryption/decryption transform (see glossary in atom.c<br>
&gt; for definitions). In particular, it can support algorithms with the<br>
&gt; EOF issue (which require to pad the end of file by extra-data).<br>
&gt;<br>
&gt; In most cases crypt translator translates the pair (offset, count)<br>
&gt; passed by user to different values, and resolves individual -&gt;write()<br>
&gt; -&gt;truncate(), etc. file operations to read-modify-write sequences.<br>
&gt;<br>
&gt; A volume can contain files encrypted by different algorithms. For<br>
&gt; newly created files one can specify desirable algorithm at mount time<br>
&gt; via a respective option of crypt translator.<br>
&gt;<br>
&gt; Currently only one algorithm is supported: AES_XTS.<br>
&gt;<br>
&gt; Example of algorithms, which can not be supported by this pair of<br>
&gt; translators:<br>
&gt;<br>
&gt; 1. Asymmetric block cipher algorithms, which inflate data, e.g. RSA;<br>
&gt; 2. Symmetric block cipher algorithms with inline MACs for data<br>
&gt;    authentication.<br>
&gt;<br>
&gt;                    2. Implementation notes.<br>
&gt;<br>
&gt; a) Atomic algorithms<br>
&gt;<br>
&gt; Since any process in a stackable file system manipulates with local<br>
&gt; data (which can be obsoleted by local data of another process), atomic<br>
&gt; cipher algorithms without proper support can lead to non-POSIX<br>
&gt; behavior. To resolve the &quot;collisions&quot; we introduce a special helper<br>
&gt; translator (features/oplock), which works on the server and manages<br>
&gt; requests (queues, grants access) of read/write issued by the clients.<br>
&gt; When an exclusive access is granted to client, the last one performs<br>
&gt; cipher transform and proceeds the stack. After all the client&#39;s work<br>
&gt; is done on the server, the oplock translator drops the access, and<br>
&gt; wakes up the next request in the queue (if any). Our implementation<br>
&gt; guarantees that an access will be granted to every concurrent process,<br>
&gt; which accesses the same file (i.e. the process won&#39;t hang).<br>
&gt;<br>
&gt; b) Algorithms with EOF issue<br>
&gt;<br>
&gt; Such algorithms require to pad the end of file with some extra-data.<br>
&gt; Without proper support this will result in losing information about<br>
&gt; real file size. Keeping a track of real file size is a responsibility<br>
&gt; of the mentioned features/oplock translator. When writing/truncating a<br>
&gt; file, the oplock translator cuts the padding and stores the last one<br>
&gt; as a special extended attribute with the key &quot;trusted.ceof&quot;. When<br>
&gt; reading a file, oplock translator appends the respective padding. So,<br>
&gt; in the bricks every file has its real size.<br>
&gt;<br>
&gt; Comment. This makes transparent encryption incompatible with GlusterFS<br>
&gt; striping and replication translators, which spawn extra-writes to<br>
&gt; stripe/replica files without due interaction with the oplock<br>
&gt; translator.<br>
&gt;<br>
&gt;                   3. Non-trusted servers and<br>
&gt;                      Metadata authentication<br>
&gt;<br>
&gt; We assume that server, where user&#39;s data is stored on is non-trusted.<br>
&gt; It means that the server can be subjected to various attacks directed<br>
&gt; to reveal user&#39;s encrypted personal data. We provide protection<br>
&gt; against such attacks.<br>
&gt;<br>
&gt; Every encrypted file has specific private attributes (cipher algorithm<br>
&gt; id, atom size, trusted object id, etc), which are packed to a string<br>
&gt; (so-called &quot;format string&quot;) and stored as a special extended attribute<br>
&gt; with the key &quot;trusted.cfmt&quot;. We protect the string from tampering.<br>
&gt; This protection is mandatory, hardcoded and is always on. Without such<br>
&gt; protection various attacks (based on extending the scope of per-file<br>
&gt; secret keys) are possible.<br>
&gt;<br>
&gt; Our authentication method has been developed in tight collaboration<br>
&gt; with Red Hat security team and is implemented as &quot;metadata loader of<br>
&gt; version 1&quot; (see file metadata.c). This method is NIST-compliant and is<br>
&gt; based on checking 8-byte per-link MACs created(updated) by<br>
&gt; FOP-&gt;create(), FOP-&gt;link(), FOP-&gt;unlink(), FOP-&gt;rename() by the<br>
&gt; following unique entities:<br>
&gt;<br>
&gt; . link name;<br>
&gt; . trusted file&#39;s uuid, specially created on the (trusted) client side<br>
&gt;<br>
&gt; Every time, before manipulating with a file, we check it&#39;s MACs at<br>
&gt; FOP-&gt;open() time. Some FOPs don&#39;t require a file to be opened (e.g.<br>
&gt; FOP-&gt;truncate()). In such cases the crypt translator opens the file<br>
&gt; mandatory.<br>
&gt;<br>
&gt;                         4. Generating keys<br>
&gt;<br>
&gt; Unique per-file keys are derived by NIST-compliant methods (file<br>
&gt; keys.c) from the<br>
&gt;<br>
&gt; a) parent key;<br>
&gt; b) unique trusted object-id of the file;<br>
&gt;<br>
&gt; Per-volume master key, provided by user at mount time is in the root<br>
&gt; of this &quot;tree of keys&quot;.<br>
&gt;<br>
&gt; Those keys are used to:<br>
&gt;<br>
&gt; 1) encrypt/decrypt file data;<br>
&gt; 2) encrypt/decrypt file metadata;<br>
&gt; 3) create per-file and per-link MACs for metadata authentication.<br>
&gt;<br>
&gt;                           5. Instructions<br>
&gt;                   how to use the new functionality<br>
&gt;<br>
&gt; 1) Specify an option &quot;encrypt&quot; when creating a volume.<br>
&gt;<br>
&gt;    Example:<br>
&gt;    # gluster volume create myvol encrypt pepelac:/root/exp8<br>
&gt;<br>
&gt; 2) On the client side, when mounting a volume, specify the absolute<br>
&gt;    name of the file, which contains per-volume master key, overriding<br>
&gt;    the option &quot;key&quot; of the crypt translator. This file should contain<br>
&gt;    256-bit AES key in the hex form, i.e. 64 symbols. Crypt translator<br>
&gt;    accepts the first 64 symbols of the specified file.<br>
&gt;    Other extra-symbols are ignored.<br>
&gt;    After successful mount the file with master key may be removed.<br>
&gt;<br>
&gt;    Example:<br>
&gt;    # glusterfs --xlator-option=myvol-crypt.key=/home/edward/mykey \<br>
&gt;      --volfile-id=myvol --volfile-server=pepelac /mnt/gluster<br>
&gt;<br>
&gt; WARNING! Losing the master key means losing the data of the whole<br>
&gt; volume without any chances to recovery.<br>
&gt;<br>
&gt;                6. Options of the crypt translator<br>
&gt;<br>
&gt; . &quot;key&quot; (specifies names of the file which contains per-volume master<br>
&gt; key); . &quot;kbits&quot; (specifies size of per-file key for data encryption),<br>
&gt;    possible values:<br>
&gt;    . &quot;256&quot; default value<br>
&gt;    . &quot;512&quot;<br>
&gt; . &quot;blocksize&quot; (specifies the atom size), possible values:<br>
&gt;    . &quot;512&quot;<br>
&gt;    . &quot;1024&quot;<br>
&gt;    . &quot;2048&quot;<br>
&gt;    . &quot;4096&quot; default value;<br>
&gt; . id of algorithm for data encryption (hidden option);<br>
&gt; . id of metadata loader (hidden option);<br>
&gt;<br>
&gt;                        7. Test cases<br>
&gt;<br>
&gt; Any workload, which involves the following file operations:<br>
&gt;<br>
&gt; -&gt;create();<br>
&gt; -&gt;open();<br>
&gt; -&gt;readv();<br>
&gt; -&gt;writev();<br>
&gt; -&gt;truncate();<br>
&gt; -&gt;ftruncate();<br>
&gt; -&gt;link();<br>
&gt; -&gt;unlink();<br>
&gt; -&gt;rename();<br>
&gt;<br>
&gt;                         8. TODOs:<br>
&gt;<br>
&gt; 1) Currently iov_len coincides with atom_size (4K by default). We can<br>
&gt;    introduce larger units for IOs to improve performance.<br>
&gt;<br>
&gt; 2) Show encryption status (on/off) of the volume in gluster volume<br>
&gt; info.<br>
&gt;<br>
&gt; Change-Id: I2601fe95c5c4dc5b22308a53d0cbdc071d5e5cee<br>
&gt; Signed-off-by: Edward Shishkin &lt;<a href="mailto:edward@redhat.com">edward@redhat.com</a>&gt;<br>
&gt; ---<br>
&gt; M cli/src/cli-cmd-parser.c<br>
&gt; M <a href="http://configure.ac" target="_blank">configure.ac</a><br>
&gt; M doc/gluster.8<br>
&gt; M xlators/encryption/Makefile.am<br>
&gt; A xlators/encryption/crypt/Makefile.am<br>
&gt; A xlators/encryption/crypt/src/Makefile.am<br>
&gt; A xlators/encryption/crypt/src/atom.c<br>
&gt; A xlators/encryption/crypt/src/crypt-common.h<br>
&gt; A xlators/encryption/crypt/src/crypt-mem-types.h<br>
&gt; A xlators/encryption/crypt/src/crypt.c<br>
&gt; A xlators/encryption/crypt/src/crypt.h<br>
&gt; A xlators/encryption/crypt/src/data.c<br>
&gt; A xlators/encryption/crypt/src/keys.c<br>
&gt; A xlators/encryption/crypt/src/metadata.c<br>
&gt; A xlators/encryption/crypt/src/metadata.h<br>
&gt; M xlators/features/Makefile.am<br>
&gt; A xlators/features/oplock/Makefile.am<br>
&gt; A xlators/features/oplock/src/Makefile.am<br>
&gt; A xlators/features/oplock/src/oplock-mem-types.h<br>
&gt; A xlators/features/oplock/src/oplock.c<br>
&gt; A xlators/features/oplock/src/oplock.h<br>
&gt; M xlators/mgmt/glusterd/src/glusterd-volgen.c<br>
&gt; M xlators/mgmt/glusterd/src/glusterd-volume-ops.c<br>
&gt; M xlators/mgmt/glusterd/src/glusterd.h<br>
&gt; 24 files changed, 10,159 insertions(+), 19 deletions(-)<br>
&gt;<br>
&gt;<br>
&gt;   git pull ssh://<a href="http://git.gluster.org/glusterfs" target="_blank">git.gluster.org/glusterfs</a> refs/changes/67/4667/1<br>
&gt; --<br>
&gt; To view, visit <a href="http://review.gluster.org/4667" target="_blank">http://review.gluster.org/4667</a><br>
&gt; To unsubscribe, visit <a href="http://review.gluster.org/settings" target="_blank">http://review.gluster.org/settings</a><br>
&gt;<br>
&gt; Gerrit-MessageType: newchange<br>
&gt; Gerrit-Change-Id: I2601fe95c5c4dc5b22308a53d0cbdc071d5e5cee<br>
&gt; Gerrit-PatchSet: 1<br>
&gt; Gerrit-Project: glusterfs<br>
&gt; Gerrit-Branch: master<br>
&gt; Gerrit-Owner: Edward Shishkin &lt;<a href="mailto:edward.shishkin@gmail.com">edward.shishkin@gmail.com</a>&gt;<br>
<br>
<br>
</div></div>_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@nongnu.org">Gluster-devel@nongnu.org</a><br>
<a href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
</blockquote></div><br>