Building a Fully Encrypted NAS On OpenBSD
mistermark writes "Two years ago this community discussed my encrypted file server. That machine has kept running and running up until a failing drive and a power outage this last week. So, it's time to revise everything and add RAID to it as well. Now you can have an on-the-fly encrypting/decrypting NAS with the data security of RAID, all in one. Here is the how-to."
mistermark's failed hard drive only further confirms that BSD is, in fact, dying.
Wow, that was a pretty in-depth how-to. It even has a mechanism (via cron) to notify you within 15 minutes if a drive fails. This sounds like a pretty interesting solution. I think I may have to give it a try with a spare box I have laying around. Thanks mistermark. I'm impressed.
Network Attached Storage
One step in the long process. Kudo's and gratitude for putting this up, it will certainly make my process easier.
I wonder, are there any full HOWTO's on this? 802.1x and IPSec both come to mind. The protection is useless if the server is powered on of course.
Me failed English...
FreeBSD over Linux. If my comments seem odd, this may explain...
Yes but... does it run on Linux?
Although, since the OS is just there to boot and allow access to data, I was thinking of using a 1GB CF card to put the OS on. I like the RAID 1 setup the instructions are easy to follow, but how about other RAIDs?
Kdawson clearly killed the other editors, and is now posting all stories. If you see anyone else posting, it's actually kdawson using their account. Look for more dupes, April Fool's Day jokes, and Slashvertisements soon.
Right from the initial install, by default, this should work.
Encrypted backups should be default and easy, with reminders.
You need multiple keys: whole-system, per-user, and swap. The swap key gets replaced at boot with something random.
Ultimately, it needs mandatory encryption. This would exclude OpenBSD; you need a mandatory policy framework like SE Linux to make it happen. Mandatory encryption means that normal users are prohibited from removing data from the machine without first encrypting it in an approved way. This most likely solves part of the backup problem. It also reduces the insider threat, while still allowing transfer of data between secure machines.
Any idea if OpenBSD supports Sun's ZFS filesystem?
-metric
but can it do 2 gzips at the same time!?
Censorship is obscene. Patriotism is bigotry. Faith is a vice. Slashdot 2.0 sucks.
1. download FreeNAS
2. install to USB/CF drive (it needs ~32Mb)
3. configure * reboot on the USB/CF drive (or if your mobo cant boot to those, maybe a CD or spare HD)
4. ?
5. Profit!
Tm
Support TBI Research: http://www.raisinhope.org
You can install Debian Etch and let the installer do it for you.
FreeNas does encryption now?
I want a new quote. One that won't spill. One that don't cost too much. Or come in a pill.
Seeing as that he uses per-volume encryption, this is pretty useless. It makes his 'server' pretty much a single-user NAS box, because as soon as another user gets an account to access the file server, they get access to the data.
Data encryption on a fileserver only makes sense if it is done on a per-user level. This is not News for Nerds, as this is basically just another implementation of how to encrypt your local disk.
Mart"I know I will be modded down for this": where's the option '-1, Asking for it'?
USB was o.k. last year, but with 20GB/sec effective transfer rate at most, it simply doesn't do a large modern HDD justice anymore.
Jeeeeezus! Either I'm way behind the times, or your "GB" was meant to be perhaps a thousand times smaller.
It does not. If we read through the article we do find, however, that the author suggests FreeNAS for a NAS, OR CryptoBox for hardware encryption. IMHO neither solution leads to the extension into a full blown server that the OpenBSD option gives.
My $0.02 AU
Me failed English...
FreeBSD over Linux. If my comments seem odd, this may explain...
Yes, it does. AES, Blowfish, and 3DES. And it also does RAID.
I don't respond to AC's.
Use dm-crypt with LUKS in the aes-cbc-essiv:sha256 mode (should be the default). There are policy issues and known plaintext attacks against loop-AES unless you the multi-key setup which _isn't_ the default... by the times the issues were widely known people were using LUKS because key management is more flexible.
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
All the *BSD is dying posts are contained in this one post. If you have mod points, please mod this up so that everybody will know that *BSD is dying! No need to post your own, as it will only be redundant!
Oh, and if I've missed any, please add your troll as a reply and I'll include it in the next Troll-in-one.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
The *BSD Wailing Song
What's left for me to see
In my ship I sailed so far
What can the answer be
Don't know what the questions are.
And after all I've done
Still I cannot feel the sun
Tell me save me
In the end our lost souls must repent.
I must know it is for certain
Can it be the final curtain
As long as the wind will blow
I'll be searching high and low.
Who knows what's really true
They say the end is so near
Why are we all so cruel
We just fill ourselves with fear.
And heaven and hell will turn
All that we love shall burn
Hear me trust me
In the end our lost sould must repent.
I must know it is for certain
Can it be the final curtain
As long as the wind will blow
I'll be searching high and low
Final curtain
Final curtain
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
pressed to bsd lips
bsd drink up
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
I don't want to start a holy war here, but what is the deal with you BSD fanatics? I've been sitting here at my freelance gig in front of a BSD box (a PIII 800 w/512 Megs of RAM) for about 20 minutes now while it attempts to copy a 17 Meg file from one folder on the hard drive to another folder. 20 minutes. At home, on my Pentium Pro 200 running NT 4, which by all standards should be a lot slower than this BSD box, the same operation would take about 2 minutes. If that.
In addition, during this file transfer, Netscape will not work. And everything else has ground to a halt. Even Emacs Lite is straining to keep up as I type this.
I won't bore you with the laundry list of other problems that I've encountered while working on various BSD machines, but suffice it to say there have been many, not the least of which is I've never seen a BSD box that has run faster than its Windows counterpart, despite the BSD machines faster chip architecture. My 486/66 with 8 megs of ram runs faster than this 800 mhz machine at times. From a productivity standpoint, I don't get how people can claim that BSD is a "superior" machine.
BSD addicts, flame me if you'd like, but I'd rather hear some intelligent reasons why anyone would choose to use a BSD over other faster, cheaper, more stable systems.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
It is common knowledge that *BSD is dying. Almost everyone knows that ever hapless *BSD is mired in an irrecoverable and mortifying tangle of fatal trouble. It is perhaps anybody's guess as to which *BSD is the worst off of an admittedly suffering *BSD community. The numbers continue to decline for *BSD but FreeBSD may be hurting the most. Look at the numbers. The erosion of user base for FreeBSD continues in a head spinning downward spiral.
OpenBSD leader Theo states that there are 7000 users of OpenBSD. How many users of BSD are there? Let's see. The number of OpenBSD versus NetBSD posts on Usenet is roughly in ratio of 5 to 1. Therefore there are about 7000/5 = 1400 NetBSD users. BSD/OS posts on Usenet are about half of the volume of NetBSD posts. Therefore there are about 700 users of BSD/OS. A recent article put FreeBSD at about 80 percent of the *BSD market. Therefore there are (7000+1400+700)*4 = 36400 FreeBSD users. This is consistent with the number of FreeBSD Usenet posts.
Due to the troubles of Walnut Creek, abysmal sales and so on, FreeBSD went out of business and was taken over by BSDI
Uhhh....You can do that with FOSS. It just doesnt have a pretty GUI.
Comment removed based on user account deletion
Since LUKS supports PKCS-5 style iterative hashing of the passphrase, it's a good idea to use that too. A million iterations only take a few seconds (10 on my 1.5Ghz Athlon) to compute at mount time, but make dictionary attacks a million times harder.
you might have to settle for small business edition...there is no "home server" --> http://www.microsoft.com/windows/products/windowsv ista/editions/default.mspx
www.purevolume.com/martyd
Comment removed based on user account deletion
The man just made a highly detailed how-to for something quite complecated, and all you can do is be a whiney bitch. Christ, you need your internet membership revoked. You seriously owe me a cup of green tea. (I've had to reduce my coffee intake on the advice of my doctor)
It looks like what I want, especially the spin-down of unused drives and the separate use of each disk.
What I like less is the mandatory use of ReiserFS. Any idea if they plan to support other filesystems?
Do you have actual experience with this product?
What! You are saying that Ubuntu doesn't do this on install? Even the Debian Installer has support for these kind of setups.
Not YET there isn't - as he said, he's looking *forward* to it. A quick Wikipedia or Google search using "Windows Home Server" will get you your info...
Really though it won't be worth it at all - more than likely I'm thinking it will be retail only (HP, Dell, etc). Also, being Server '03, I'm guessing its gonna take a bit more power to run than what a cli install of Linux or BSD can make do with, meaning less options of older underpowered machines to use which can be found for dirt cheap...
http://www.microsoft.com/windows/products/winfamil y/windowshomeserver/default.mspx
Shit I don't know what crappy USB enclosures you're using, but dam man, get something decent.
GPLv2: I want my rights, I want my phone call! DRM: What use is a phone call, if you are unable to speak?
It's late and nitpick stuff like this has been driving me nuts all week.
There shouldn't be an apostrophe in Typos...
hold you hand out... if it shakes, you have NAS
The Bible: Historically verifiable fact from an observers point of view
OpenBSD on a fileserver? Firewall, sure. Fileserver w/RAID and disk encryption, no way. I would leave that task to FreeBSD (FreeNAS) or Linux (CryptoBox, Openfiler). If you are desperate for encrypted FS + RAID you can use MD + LUKS (Linux) or GRAID5 + GELI (FreeBSD) those are all available via FreeNAS, CryptoBox, and Openfiles. Suffice to say both have proven their stability, have a rich set of features (e.g. LRW), and are simple to set-up. The end-user NAS solutions are pretty sophisticated and have good web interfaces.
20 MB/sec is quite a shit performance IMO however if you don't use gigabit it'd be good enough. With GELI there is about 55% overhead compared to plain text. I haven't compared LUKS to plain text hence can't compare. On a side note, I doubt its useful to encrypt data you're receiving from distributed areas, nor that its useful to put such data in a RAID. A NAS doesn't run BitTorrent. If you're paranoid whereas you share your data over SMB, that might be the weakest point.
For our ricer folk, a nice, expensive RAID controller is necessary. For the smart people among this planet: do software XOR by getting an EE (or SFF) dual core AMD which are cheap and have a a low 10 idle W and have a low TDP (the SFF has 35W TDP). Get 4 Samsung SpinPoint T166 SATA (silent, low power, best bang for buck) and you have 1,5 TB RAID. All in all this costs about 650 EUR (probably less in USA) w/all hardware new including case, 2 * 1 GB RAM (2 * 0,5 GB would suffice too), and PSU. I should know, I bought and build such machine.
Forget ZFS for now. OpenSolaris has bad hardware support, and it is only partly ported on FreeBSD 7.0-CURRENT where it isn't stable and a bug in it takes the whole system down. While it does have a rich set of features, it also doesn't support encryption yet, although the feature has been planned for a year and perhaps on FreeBSD it can be used together with GELI. Performance of ZFS is also not to write home about compared to GRAID5. ZFS isn't mature yet. Nor is FreeBSD 7.0-CURRENT, ofcourse. It'll be part of FreeBSD 7.0 however, as an experimental feature.
WE DON'T NEED NO BLOG CONTROL.
So he made a few mistakes which you consider stupid. TBH, as soon as anyone says "NAS" without considering RAID and backups, I think they're on a path to pain.
/. article.
But at the end of the day, no matter how many things you think about, no matter how much effort you go to, there is always something that gets missed. AFAICT, he's only got one power supply and no UPS on there, and on any large filesystem I'd consider journalling (or Soft Updates on OpenBSD) a must these days.
You can build a system in which nothing is missed, and it always works no matter what happens. But then you're talking realtime mirroring across at least two sites, gigabit links between the sites and regular DR tests to make sure everything works as intended. A little more sophisticated than your average
Network Attached Storage, Neural Attentuation Syndrome, Network Access Server...
People need to stop using this and find more unique alternatives. Along with "MAC".
Yeah, and shouldn't he have said "nitpicky stuff"?
Actually you're wrong. FreeNas does encryption. 3 kinds, even.
I don't respond to AC's.
Procrastination -- because good things come to those who wait.
"Why do you have a captain's wheel around your waist?"
I feel fantastic, and I'm still alive.
I will never claim to be perfect, but when a howto makes the _frontpage of slashdot_ I assume the person who wrote it knows what he is talking about.
Judging by his mistake with the fsck he forgot the last time I sure as hell hope people don't just blindly follow his directions this time. God knows what he might have missed this time around.
Had it not made the frontpage and/or had been buried in askslashdot I couldn't have cared less.
I use it and it is a charm. The only feature missing is S3 suspend support and wake on lan, which is high on the list of features for the next version.
Particularly for a server that has large files, but infrequent use (think media server with movies and ISOs) drives can sleep for weeks. So less wear and tear on the drives, less noise, and less power.
What's the issue with RFS? I don't care if the guy is an axe murderer... the FS is good.
You won't be decrypting it without a key.
If you do in fact have the key on your laptop, then you must have been authorized to carry the data around without encryption. That would be unusual.
The idea is that you can put an encrypted blob onto your insecure laptop, take this to a different secure machine which has the key, and then get access to the content on that secure machine. The laptop (or DVD-R, or CompactFlash) can't decrypt since it lacks the key.
...does its milkshake bring all the boys to the yard?
Software RAID... sorry, but never use it. 3Ware SATA RAID cards are cheap enough that the cost savings just isn't worth it. I consider my data to be worth the extra couple hundred bucks rather than monkey around with SW RAID that is a real pain to rebuild. For the REALLY important stuff, I use an Adaptec 3400 RAID card with 10 SCSI drives, and sustain 86 MB/s over a RAID-5. You can get this stuff off eBay cheaply enough that cash isn't a real issue at all.
I do have a server like that, but without RAID. Deliberately, because I do not want all drives to spin up when I watch a movie. The rootfs is on IDE-FLASH and the system is silent when not in use.
The redundancy solution in this product looks nice. Pity that it is closed source.
As a SuSE user I have ReiserFS filesystems on many systems, but on my mediaserver I used EXT3. It is slower, but for the operations done on this server it is not important. It looks like ReiserFS is on the way to be deprecated in Linux, and with no in-place conversion utilities available I would hate to be left with terabytes of data that is getting harder and harder to access.
Does the UnRaid support only SMB? Or can it do NFS as well?
Really? I'd not heard that...is it because the developer is in jail?
What FS appears to be the one to use now on a Linux system?
Light travels faster than sound. This is why some people appear bright until you hear them speak.........
I think it is not mainly because Hans Reiser is in jail. The relation between Hans and the kernel developers has been difficult all the time.
Some time ago, maintenance on version 3.6 has been abandoned by Hans Reiser in favor of working on the 4.0 version. A few people at SuSE continued to work on it, but received negative comments from Reiser (who accused them of introducing new bugs). Of course the environment at SuSE has changed as well, and there has been an announcement that they will stop as well.
That leaves the 3.6 version without maintenance. We can only guess for how long it will survive in a changing kernel without becoming unstable or before it even no longer compiles.
The new version 4 has not been accepted into the official kernel, and the situation around Reiser likely has not increased the chance that it will be.
The developers state that EXT3 has been improved and will be further improved. That is probably the most used native Linux filesystem.
And of course other alternatives (ported from other systems) are becoming available.
All in all it is a bit sad, ReiserFS was a fast filesystem and I have good experience with it. But I am using Linux for nearly 15 years now, and if there is one thing I have learned it is that it is useless to row against the flow. When official support for something is being dropped, you have to look for an alternative.
LOL, somebody modded me up without clicking on the link. It was a joke, folks; that wiki is for the rapper who goes by the name "Nas".
Procrastination -- because good things come to those who wait.
What's your opinion on say, XFS? I'd thought to move to that...especially on drives I'm working with video and other large files...
Light travels faster than sound. This is why some people appear bright until you hear them speak.........
Call me when this runs on my 266MHz ARM box, aka the Linksys NSLU2. My current setup is Debian Etch installed to a flash drive, and 2 250GB disks in RAID-1 w/ LVM hung off the USB ports. Near silent, and sucks about 10W of power.
I want to delete my account but Slashdot doesn't allow it.
When users leave, their keys and passphrases should be deactivated so they can't use them later to gain unauthorized access. This is nontrivial because it implies that every file they've ever had the key for need to be re-encrypted with a new random key, which is a lot of processing. Practically speaking, it's better to assume that anyone who has access to the data has actually copied every available bit of plaintext and key material and plan the threat model and security around that assumption. In light of that, it may actually make sense to encrypt on both the client and the server. The server is assumed to have a key that no user knows, and the users have keys that the server doesn't know. Only collusion between a server administrator and a user would be sufficient to retrieve all the encryption keys necessary to do bulk decryption of stolen media, and only for the keys the user knows.
Key escrow is for users who forget their passwords. It also prevents the loss of data due to the loss of individuals (through firing, quiting, or death). Secret sharing can be used to ensure that n or more administrators are required to recover a key, for some n>0
I looked at a FreeBSD NAS project (don't remember the name though- I've slept since then. FreeNAS?) that looked really neat. Booted from USB key so only data was on the drives. I was impressed what with I ready until I hit the part in the docs where it didn't work with Silicon Image 311x SATA chipsets. The most common fudging chipsets out there. Linux has no problems with that chipset but the FreeBSD has major ones?
That totally harshed my buzz on the thought of the project and put FreeBSD on the "still not ready for prime time" list for me. I'm hoping they will someday get that compatibility working some year because the project looks very promising.
I will never claim to be perfect, but when a howto makes the _frontpage of slashdot_ I assume the person who wrote it knows what he is talking about.
You must be new here.
Give me Classic Slashdot or give me death!
Naturally with an encrypted disk your going to have slower throughput. I've been considering setting up some sort delayed encryption scheme where you have a 10-20GiB area of unencrypted space, when something gets written to this portion it will be encrypted at a later time. I'm thinking it may be possible with unionfs/aufs or maybe with a custom script or FUSE filesystem.
Anyway, if your situation will permit data not be encrypted immediately, this would be a good compromise between speed and security....
Icemaann
http://www.nugg.org
Kind of deal killer.
Just to clarify - unRAID doesn't have RAID either. Each disk is ReiserFS formatted as standard and can be pulled\mounted elsewhere. The only thing really non-standard is the use of a parity disk to store ones and zeros from the other drives. Drives spin down unless in use and parity will spin down too unless a write is being done. I have 12 drives in my system and normally 10 of them are sleeping while Bittorrent runs on a workstation writing to it. Performance isn't as good as some installations but for streaming it rox! Do SATA and performance is better, mine is all IDE. There are free versions available too and source is available when you boot it up....
Build it, Drive it, Improve it! Hybridz.org
Unlike his peers, I've found that he does manage to rap in something resembling english. I even manage to like one of his tracks ("Hip Hop Is Dead", which is assembled from all kinds of familiar and comfortable samples, loops, and structures), which is really quite amazing to me.
Procrastination -- because good things come to those who wait.
I will try to boot it up (first attempt failed as my system apparently won't boot from USB key so I will try something else) to see which sources are available.
I understood the workings of the parity disk, let's see if that is implemented in the kernel like RAID or if the whole thing lives in the userspace application.
It might be possible to just port over the parity idea to my existing server (which is running SuSE 10.0 from a 512MB IDE-FLASH disk)
Of course with this idea, each write will transform into two reads and two writes (to re-calc and update parity) so write performance probably suffers. Read should be as fast as a single drive, unless the method of implementation slows it down.
What FS appears to be the one to use now on a Linux system?
/boot, reiser for the system partitions and xfs for mysql data/log partitions.
There isn't one true filesystem. It depends on what you're doing with it. Reiser is really good for lots of small files, JFS is good for quickly deleting large files (MythTV box for instance). In testing I did for mysql with our particular useage patterns, XFS was *way* faster than JFS, reiser or ext3.
So our typical mysql box will have 3 different filesystems. ext2 for
Really, you should experiment with the applications you use in your environment.
Yes, writes are slower! However depending upon what it is you're trying to do that's not a really bad penalty. For a home user who wants to have a large NAS feeding an HTPC this works out great. Do NOT try to rip a DVD straight to it though (lol) as I found the performance maddening but ripping local, copying in background, and then streaming works very well in my case. The author has open sourced his changes to GPL code but has NOT done so with his management application which is his right, it's a pay for play application that I support and is geared for home users. It could perhaps be taken in other directions too, I've suggested it on the Ubuntu @ home forum that's building a home server to counter Microsoft's effort :-) Having used this software for more than a year I've found it mostly meets my needs and has gotten me through 2 drive failures no problems but did fail me when I did something stupid software wise but only lost two drives worth of data. I do not bitch about that too much as it was beta code I was running, oh well.
;-)
If you get too stuck getting to the source you might ask on their forums or if I can figure out, again, how to get at the source perhaps send it along. I cannot add much of anything to tweaking it but would happily enable others so inclined so long a sit's not a deluge of requests
Build it, Drive it, Improve it! Hybridz.org
You are using subjective judgments there. You have no way to know if the guy with the keys for the "safe" datacentre may be bribed to pull your disk and make a runner.
Encrypting cost you little and contributes to your peace of mind, it does not solve all problems, but at least addresses the one where a thief with light feet is involved....
IANAL but write like a drunk one.