So I recently had a buddy of mine pen test my SFTP. While the SFTP isn't open to the general public, it is accessible via the Net, so I treat it like everyone in the world has at least user level access. While it got an overall good bill of health he did point out one key issue, that users had the ability to max out the HDD and render the box useless, or at least incredibly slow. So that's where it began. I discovered disk quotas.
Of course most of us know of disk quotas, or at least their general theory. It's what limits our gmail Inbox folder, stops us from filling the school server with porn, and all sorts of practical limitations on users. Basically they just keep us in line in regards to how much space we're allowed to use on a particular drive. Honestly they're not very difficult to setup, at least not with Gentoo. In fact to get started you only need to head
here and give it a run-through. The only problem came when I discovered that quota support on my file system of choice,
XFS, was...less than well documented.
So, after three days of poking around IRC, reading man pages, HOW-TO's, manuals, asking the programmers who wrote quota itself, Googling, and reading old XFS mailing list threads, I found all the answers. So I hope to make it easier on others with a simple guide here. I've already sent these modifications to the maintainer of the
Gentoo Security Guide, so hopefully they'll make it into that shortly and no one will ever have a need to read this, but if you do, enjoy.