4 ms·
There are a few scenarios in which client-side certificates just aren't good enough by themselves. So you have folks administering the servers. A certain perc
by klodolph 14y ago
There are a few scenarios in which client-side certificates just aren't good enough by themselves.
So you have folks administering the servers. A certain percentage of them need root access. One of them gets his certificate revoked and then laid off -- in that order -- but he already installed a back door account. Okay, so you're a good admin and you check the logs and make everyone use "sudo" for everything.
* But maybe it won't even show up in the logs. Maybe he was editing a file in sudo with vi and ran ":! bash". Okay, so you're a good admin and disabled that.
* Maybe he was editing crontab one day and added a one-shot script to create a nefarious account. Okay, you are a good admin and you have tripwires.
* Maybe he knows where your tripwires are. Do you honestly think you know every possible attack vector someone with legitimate sudo access could use?
It's really hard to stop an inside job. The principle of least privilege is a nice maxim, but there's a cost to figuring out exactly what the least privilege is, and there's a cost to giving someone too little privilege -- downtime when they can't fix something they're supposed to fix.
- lancewiggs 14y agoMaybe it's you - the person responsible for security.
- keithpeter 14y ago"Maybe he was editing a file in sudo with vi and ran ":! bash"" Ah, yes, works on a default Ubuntu desktop install provided you have vim installed (not the usual tiny-vim package that uses nano for visudo editing).
- iso8859-1 14y agowhy wouldn't it work? sudo -s works too. sudo su. sudo bash.
- klodolph 14y ago1) All sudo commands show up in the logs. You can put the logs on another server, possibly a server where only the head of IT has sudo privileges, possibly one that automatically replicates to other sites. Seeing a "sudo su", "sudo bash", or "sudo -s" in the logs could get you reprimanded, and if there's a security breach it could make you a suspect. 2) You can disable sudo -s, sudo su, and sudo bash. Maybe the people with root access only need to run a few commands and edit a few files as root, so you whitelist those. But as I mentioned, if they need to edit crontab you've probably given away the keys to the kingdom right there. There are more attack vectors you can enable without knowing about it and you've got a business to run, so you make a cost/benefit analysis -- it's always a trade-off between efficiency and security.
- Evbn 14y agoIsn't 'sudo vi' already game over? :sp /bin/vi ... :wq
- klodolph 14y ago> Isn't 'sudo vi' already game over? Yes, I wasn't very clear when I said the following... > Okay, so you're a good admin and disabled that. What I mean is that you disable "sudo vi" access, and allow "sudoedit" access. Suddenly you only have write access to certain files. But which files? These people need to administer the server, but at the same time you want to prevent them from creating a backdoor, or at least you want to know about it if they do. /etc/crontab is just an obvious example. Maybe you can get suborn a filter somewhere that runs as root, or poison the environment variables of a legitimate script.
- deleted 14y ago[deleted]
- nitrogen 14y agoWhen in elementary school I would use a similar technique to get a command line: Word Perfect for DOS could launch command.com.
- danielweber 14y agoI once wrote a tool to automatically connect to all the company boxes. I became actually frightened by it, because in the wrong hands the tool could destroy the company in a matter of minutes. I eventually just deleted it and discouraged anyone from building another.
- sargun 14y agoHow does this differ from tools like puppet or mcollective, which are commonly deployed in operational environments today, and almost necessary for day-to-day operations?
- jahewson 14y agoPuppet use client certificates, and is pull-only so you'd need to hack the puppet master machine to cause any damage.
- antihero 14y agoYou shouldn't have destroyed the tool, you should have just prevented it working so easily, else someone else could build a tool.
- Yuioup 14y ago... or maybe the WoW servers run on Windows luke the clients do.
- Yuioup 14y agoluke=like
- rst 14y agoOne defense strategy that mitigates some of these threats is requiring all "back-door" access from the public internet to go through a few minimally-configured, easily audited bastion hosts. (As in, packets from outside to port 22 on machines other than the bastion hosts just get black-holed.) After which, of course, an audit is part of the process of locking people out, along with cancelling credentials on the bastion hosts specifically. This doesn't cure everything, of course. There are a lot of places in many server environments where a determined miscreant can hide time bombs. (Oracle DBMS_JOBs anyone?) But it can be a useful component of defense in depth...
- tptacek 14y agoAgree strongly, and recommend this architecture to clients. If you can, get all this stuff behind a VPN too, so that the address of the bastion host is nonroutable.