-
szilard
I have got this encrypted dataset:
-
szilard
```
-
szilard
NAME PROPERTY VALUE SOURCE
-
szilard
tank/storage/test encryption aes-256-ccm -
-
szilard
```
-
szilard
as you can see, the key source is "-". The system mounts the dataset just fine automatically after a reboot. I am wondering where is the key is stored?
-
danmcd
Look for "keylocation" "keyformat" and "pbkdf2iters" properties in this dataset?
-
danmcd
`zfs get keylocation,keyformat,pbkdf2iters tank/storage/test ` ?
-
danmcd
And that's not the "key source" that's the "Source of who set this property".
-
danmcd
E.g.
-
danmcd
[root@moe (kebecloud) ~]# zfs get volblocksize zones/swap
-
danmcd
NAME PROPERTY VALUE SOURCE
-
danmcd
zones/swap volblocksize 4K -
-
danmcd
[root@moe (kebecloud) ~]#
-
danmcd
That swap zvol was created with 4k.
-
danmcd
zones/swap sync always local
-
danmcd
Changed locally.
-
danmcd
My unencrypted boot pool's top-level ZFS filesystem has encryption properties even if it's a cleartext one:
-
danmcd
bootpool encryption off default
-
danmcd
bootpool keylocation none default
-
danmcd
bootpool keyformat none default
-
danmcd
bootpool pbkdf2iters 0 default
-
danmcd
I'll bet yours, szilard , are far more instructive.
-
tsoome
SOURCE column is not for key source, it is where from the property value is coming.
-
danmcd
^^^ better stated than what I said (And that's not the "key source"....)
-
szilard
Thanks for the hints!
-
szilard
It says:
-
szilard
NAME PROPERTY VALUE SOURCE
-
szilard
tank/storage/test keylocation prompt local
-
szilard
tank/storage/test keyformat passphrase -
-
szilard
tank/storage/test pbkdf2iters 350000 -
-
tsoome
so, if you enter. zfs load-key tank/storage/test, it will prompt for key
-
szilard
And what happens if i misremember the key
-
tsoome
it will ask again:)
-
szilard
I dont want to risk locking the currently unlocked dataset.
-
tsoome
it does not have built in locking system.
-
szilard
I wrote down the key, but i havent tested if it works and already stored some important info on the dataset. I am not prepared for the worst outcome.
-
tsoome
pbkdf2iters will ensure you will not to get next try too quick, but thats about it.
-
szilard
Ok, i dont have the key here with me, so the test needs to wait till i get it. But thanks, i'll definetely test it.
-
szilard
Do i assume it correctly it will ask for the key and if the correct key entered it will somehow communicate the key is OK?
-
tsoome
it will test if key is decrypting key, if so, the key is loaded into internal keystore and command will exit with status 0 (echo $?)
-
szilard
There arent too many up-to-date blogs about Solaris, but i found this, it can be interesting for you guys:
c0t0d0s0.org
-
szilard
tsoome: thanks!
-
tsoome
after that you can access the data as the data access functions will pick the key from keystore automatically
-
szilard
But i still dont know how the encrypted dataset gets mounted at boot. It didnt asks for a key, so it must be stored somewhere, or some trick is used.
-
tsoome
the passphrase is converted to the actual key by pbkdf2 key derivation function.
-
tsoome
mount does not really imply having the key
-
tsoome
but accessing the data does
-
szilard
I can access the content of the dataset without needing to supply any key after the reboot.
-
tsoome
um, are you sure the dataset is actually mounted?
-
tsoome
maybe you did copy data to mountpoint and the dataset is in fact not mounted?
-
szilard
I am using the dataset attached to a sparse zone. Let me check...
-
tsoome
you can check with df/mount/grep datasetname /etc/mnttab
-
szilard
Yep, it isnt mounted. I wrote into the mountpoint. Yeez.!
-
szilard
I need to fix this asap. Thanks for your help!
-
tsoome
yw