8 ms·
Not getting root on your own machine as a developer? That's ridiculous. I left a company where I was the lead developer because I got tired of waiting two weeks
by scarface74 9y ago
Not getting root on your own machine as a developer? That's ridiculous. I left a company where I was the lead developer because I got tired of waiting two weeks for the outside networking consultants to get resources provisioned on AWS. Our own internal network people had to wait on them.
Now I work for a much smaller company and they gave me full admin access to the AWS console from day one and I am "just" a senior developer.
- curiousgal 9y agoMost developers working on HPC systems don't have root access.
- chris_st 9y agoExactly our situation. I'd love to be able to build and deploy docker images, but the "docker is root" thing makes this impossible in our shop.
- curiousgal 9y agoHave you looked into Singularity[0]? It supports Docker containers. 0.https://singularity.lbl.gov/index.html https://singularity.lbl.gov/index.html
- chris_st 9y agoThanks! I'll check that out.
- ihnorton 9y agoIIUC building Singularity containers still requires root.
- stonogo 9y agoYou build them on your machine, or on the hub (straight from github), and then you don't need root to run them.
- cyphar 9y agoSingularity in general requires root, it's just in the form of setuid helpers. Now, you can force it to not require root but from memory there are a lot of caveats with using it that way. Unprivileged LXC is much more full-featured. And obviously rootless runc works great as well (though I'm a bit biased of course).
- stonogo 9y agoSingularity is capable of using setuid helpers, but by default it uses user namespaces (the USERNS kernel feature) and does not need the setuid helpers. Lots of things are 'more full-featured' and none of them work well in an HPC context, where individual user jobs may need to be staged carefully.
- cyphar 9y ago> Lots of things are 'more full-featured' and none of them work well in an HPC context, where individual user jobs may need to be staged carefully. After long discussions with the Singularity folks I've come to the conclusion that the only special features that Singularity has are: * Their distribution format is a binary containing a loopback block device, allowing you to have "a single thing to distribute" without concern for having to extract archives (because in theory archive extraction can be lossy or buggy). The downside is it requires (real) root to mount or a setuid helper, because mounting loopback is privileged because it opens the door to very worrying root escalation exploits. When running without setuid helpers I'm not sure how they have worked around this problem, but it probably involves extraction of some sort (invalidating the point of having a more complicated loopback device over just a tar archive). * It has integration with common tools that people use in HPC. I can't quite remember the names of those tools at the moment, but some folks I know wrote some simple wrappers around runc to make it work with those tools -- so it's just a matter of implementing wrappers and not anything more fundamental than that. Aside from those two things, there's nothing particularly different about Singularity from any other low-level container runtime (aside from the way they market themselves). A lot of people quote that Singularity lets you use your host user inside the container, but this is just a fairly simple trick where the /etc/passwd of your host is bind-mounted into the container and then everything "looks" like you're still on your host. People think this is a security feature, it isn't (in fact you could potentially argue it's slightly less secure than just running as an unprivileged user without providing a view into the host's configuration). If you really wanted this feature, you could implement it with runc's or LXC's hooks in a few minutes.
- physicsguy 9y agoIt's great if it works, but there are many cases where you can't just take a Docker container and apply it to work in Singularity. I even found this Blog Post this morning that went into some of it. https://www.sylabs.io/2018/04/singularity-compatibility-with-docker-containers/ https://www.sylabs.io/2018/04/singularity-compatibility-with...
- cyphar 9y agoI'm working on [1] and the plan is to make this work much easier for people, so they don't need to hit the "docker is root" problem anymore -- this was a pain for me a few years ago when I was a university student trying to run some code on a shared computing cluster. There's still lots of stuff left to do (like unprivileged bridge networking with TAP and similarly fun things like that). [1]: https://rootlesscontaine.rs/ https://rootlesscontaine.rs/
- voltagex_ 9y agoEver worked in government? You won't get (full) admin access there, either. I thought it was good practice to have strong separation between Dev and Production, and I'm pretty sure you're meant to create AWS keys+accounts with less-than-root access for day-to-day work.
- scarface74 9y agoYes. I create separate roles for different ec2 instances, Lambda expressions, etc. based on least privilege. With AWS databases - except for DynamoDB - you still use traditional user names/passwords most of the time. Those are stored in ParameterStore and encrypted with keys that not every service has access to. Of course key access is logged. There is a difference between the root account and an administrator account. Day to day work on the console is configuring resources. Even if you do have strong separation -in our case separate VPCs, someone has to have access to administer it. We don't have a separate "network operations" department.
- sillysaurus3 9y agoDevs like you were some of our favorite targets in the pentest world. What I wouldn't give for your ~/.bash_history file... I bet I could pivot to three different servers in under an hour. This is an exaggeration, but only slightly. :) Security costs convenience. But people love to be too lax. And it's so fun to point it out and see the look on their faces, or pop up an XSS in their favorite stack of choice. My best one was getting remote access on a server thanks to an unsanitized PDF filename. They were calling into the shell like `pdf-creator <company name.pdf>` (or whatever the utility was called). They were a B2B service, so they never thought to set anyone's company name to something like "; <reverse shell here> #" I just thought it might be fun to contrast the two worlds. Those big, stodgy companies that we love to make fun of... Those guys were some of the hardest targets. I once spent a week trying to get anything on one, and just barely got an XSS. And I was lucky to find it.
- deleted 9y ago[deleted]
- mickronome 9y agoDevelopers often are a soft target, esp. in small/medium companies, but in my experience it's more of necessity by imposed expectations from management, than people actually wanting to have "root" everywhere. But I and many others dislikes getting yelled at by management, and no one has yet to accept any reasonable security precautions as a reason for delayed delivery without promptly ordering that precaution to be summarily removed, at least not in any of the companies I worked or consulted at the last couple pf decades. If management understands that security costs time in feature development, fine. But with the role software development has these days in companies, if security and ops doesn't succeed in getting management on board, please don't hold the developers hostage! Work with them and try to find the least bad ways of working quickly enough. Many of them will support calls for better security practices as long as it doesn't imply more sleepless nights because goals haven't been changed, only the speed of which work can be done. For any substantial deployment, I really don't want to have any access as a developer, but often I have to have root access to tons of machines simply to have any chance at actually doing my work.
- jjoonathan 9y ago
- cabaalis 9y agoAs CTO at a small healthcare company, one of my primary goals is to prevent even our employees from getting unaudited access to the db in our production system. In dev, no problem.
- scarface74 9y agoHaving AWS admin privileges doesn't give you access to the database data. RDS/Aurora/Redshift instances are still controlled by your typical database privileges.
- empath75 9y agoYou should probably assume that anyone that has admin access to your aws account has complete access to everything in it. It’s too easy to get access to whatever secrets you need.
- biimugan 9y agoI don't think this is right. With RDS, for instance, you can reset the 'master' password from within the RDS console. (The RDS service itself retains the real superuser, the user RDS creates for you has some privileges dropped.) Take EC2 as another example. If you have volume attach/detach permissions and EC2 start/stop permissions, you can stop an arbitrary instance, detach its root volume, reattach it to an instance of your choosing where you have login access, log in, add whatever you want to that volume (including rootkits, etc.), and reattach it back to its initial instance. Giving someone AWS admin should be considered analogous to giving someone the keys to your racks in a datacenter. There really are many surprising ways that an AWS admin can take control of your infrastructure. Can you put countermeasures in place? Sure, but it's a huge attack surface
- staticassertion 9y agoYou know what developers do with root? They install bitcoin miners. They install malware. They install all sorts of shit. It's unfortunate but it's true, I've seen it 100x. We let our devs have local admin at my company but please don't misunderstand the serious risks involved in that decision. We take great measures to ensure that we can do that while still keeping our customers safe. We would never allow admin AWS access, that's absurd. An attacker on your box would be able to own prod. Sorry that it's an inconvenience! When you manage to solve infosec, hit your ops/sec team up, they'll be happy to hand you the keys after that point.
- scarface74 9y agoTrust but verify. AWS has plenty of logging capabilities. I'm not saying that all developers should have unfettered access. But someone has to be trusted.
- staticassertion 9y agoOf course, some people need admin capabilities. But a senior developer? Nah. Engineers whose specific job it is to admin infra, yes. Logging is great, but it's a 'we are owned, how do we get them out' measure - we want to avoid getting to that point. edit: Of course, this all depends on your threat model, posture, maturity, etc. I'm just saying - we have lots of very good reasons to lock devs out.
- scarface74 9y agoYou're assuming that a small company has a separate person solely dedicated to infrastructure. Yes I have an AWS certification and on paper I am qualified to be an "AWS Architect". But I would be twiddling my thumbs all day with not enough work to do and would die a thousands deaths if I didn't do hands on coding.
- staticassertion 9y agoAs I said in my edit, this is all subject to the details of a company's posture.
- dboreham 9y agoThis isn't what this is about (nanny state not allowing you root on yer laptop). Rather it is about the idea that software should require the necessary privileges to do its job, and no more.
- deleted 9y ago[deleted]
- cyphar 9y agoAnother major use-case of rootless containers (though image building is not as useful in that case) is being able to run things unprivileged on computing clusters. I implemented rootless containers in runc and quite a few other tools (like umoci) in order to be able to handle cases where you don't get root on a box. There is also the security benefit of there being no privileged codepath that can be exploited. So the only thing you need to worry about is kernel security (which, to be fair, has had issues in the past when it comes to user namespaces -- but you can restrict the damage with seccomp and similar tools).
- gaius 9y agoNot getting root on your own machine as a developer? That's ridiculous. That way leads to the classic “works on my machine!” response to any bug report. Developers machines should be locked down to resemble Prod.
- dewey 9y agoWhat if most of your prod setup is read-only file systems? There's probably a more suitable middle ground than locking down everything.
- scarface74 9y agoWho goes directly from their computer to Prod? I would hope that you would have at least an integration environment and automated builds and deploys.
- e12e 9y agoI don't want to run services as root, except for services that grant login rights (It's probably better to have one ssh daemon, than allow/force every user to run their own...). And even then, keep the code that can change user I'd to a minimum. I certainly don't want run big, rapid-changing code as root. Not the countinous integration pipeline, not the build pipeline. It's a misfeature of docker that it needs more privileges than a traditional chroot/fakeroot build (probably a good reason to build on those tools to build docker images, rather than rely on Dockerfile/docker build. Build images and reserve Dockerfiles for pulling in ready images and setting some parameters for configuration).