(Sorry Jeff for sending this mail only to you instead of to the mailing list)
On Tue, Jun 05, 2012 at 10:44:42AM -0400, Jeff Darcy wrote:
On 06/05/2012 08:01 AM, Yves Pagani wrote:
> I did a dd if=/dev/random of=data.key bs=1M count=1... After your mail, I
> digged a little bit in the source code and by doing a openssl enc
> -aes-256-cbc -k secret -P -md sha1 and copying the (key part only) outcome
> into a file, I was able to do a hfs_mount. Neverthless I obtained a strange
> result : from the client, I copied some file to the mount point, files were
> copied on the different servers. On the client, I then unmounted the
> filesystem and remounted it without giving the data key. And of course, the
> files were encrypted as expected. But on the servers, the files are always
> in cleared form ! Is it a normal behaviour ? I thought that when I copied
> the files to the servers, they were encrypted before being sent.
That is indeed what's supposed to happen, and I just rechecked to make sure it
does. Your result seems very strange to me, because if you mount without a
data key then the crypt translator won't even be loaded and therefore there
should be no transformations on the data . . . and yet you report that the data
read that way appears to be encrypted. If it had been stored plain, who's
encrypting it in that case? Can you send the client volfiles (from the logs)
that are being used when you mount with and without an encryption key?
I attached the client volfiles and glusterlog for 3 cases :
- with the data key
- without the key
- with a bad key
I also did more testing and I saw stranges results which are given below. Please note that
in my configuration I have 4 servers glusterfs1,glusterfs2, glusterfs3, glusterfs4 and
that glusterfs2 replicates glusterfs1 and glusterfs4 replicates glusterfs3.
- I created a file named hello1.txt (which contains only the word Hello), copied it to
have 5 more identically files named hello2..6.txt
md5sum hello*.txt gives :
09f7e02f1290be211da707a266f153b3 hello1.txt
09f7e02f1290be211da707a266f153b3 hello2.txt
09f7e02f1290be211da707a266f153b3 hello3.txt
09f7e02f1290be211da707a266f153b3 hello4.txt
09f7e02f1290be211da707a266f153b3 hello5.txt
09f7e02f1290be211da707a266f153b3 hello6.txt
- I mounted the filesystem (hfs_mount -d ~/data.key -p ~/server.key -c ~/tenant1.pem -s
~/root.pem glusterfs1 wtf toto toto /gluster/) and copied the files (copy hello*.txt
/gluster).
On each server I did a md5sum hello*.txt and I obtained the following results :
on glusterfs1 :
09f7e02f1290be211da707a266f153b3 /gluster/toto/hello3.txt
09f7e02f1290be211da707a266f153b3 /gluster/toto/hello5.txt
09f7e02f1290be211da707a266f153b3 /gluster/toto/hello6.txt
on glusterfs2 :
1494788811b7db4b2a5fc374c7331a67 /gluster/toto/hello3.txt
e2aee1de34f01b1bc99888bc20eaaef2 /gluster/toto/hello5.txt
e13ff05c010f78240a564192b3f03d40 /gluster/toto/hello6.txt
on glusterfs3 :
93e3e8cbef5041c58eef1af2091f4bdc /gluster/toto/hello1.txt
683f04b2e888387dff6a1c75ebf53e3a /gluster/toto/hello2.txt
2b73353d9b0fc05f66f50c93157986db /gluster/toto/hello4.txt
on glusterfs4 :
09f7e02f1290be211da707a266f153b3 /gluster/toto/hello1.txt
09f7e02f1290be211da707a266f153b3 /gluster/toto/hello2.txt
09f7e02f1290be211da707a266f153b3 /gluster/toto/hello4.txt
on the client :
09f7e02f1290be211da707a266f153b3 /gluster/hello1.txt
683f04b2e888387dff6a1c75ebf53e3a /gluster/hello2.txt
09f7e02f1290be211da707a266f153b3 /gluster/hello3.txt
09f7e02f1290be211da707a266f153b3 /gluster/hello4.txt
e2aee1de34f01b1bc99888bc20eaaef2 /gluster/hello5.txt
09f7e02f1290be211da707a266f153b3 /gluster/hello6.txt
So we can observe that :
- on replicated servers, one server always has the files in clear form (confirmed by a
cat hello) and the second has them in an encrypted form
- some of the files seen by the client are encrypted !
When i unmount and mount the filesystem without the encryption key, I obtained the same
results.
Neverthless when I mount the filesystem with a "bad" encryption key, the client
sees all the files encrypted (which is normal in my opinion since it means that some
encryption with the encryption key is done)
But I have no idea why I obtained such results.
--
Where are the calculations that go with a calculated risk?