Live data from Hacker News

Application Container Security Guide [pdf]

dx.doi.org

11–20 of 39 posts

Re: Application Container Security Guide [pdf]

#11
post #4

I like how there is an implied influence (e.g. dockerism) about containers being immutable/ephemeral... meanwhile I've been incredibly happy moving most of my VM deployments over to nspawn because many standards of systems management were anti-patterns in dockerland.

systemd-nspawn certainly deserves more acclaim. It's great, and really easy to use right out of the box.

Re: Application Container Security Guide [pdf]

#12
post #8

Earlier quoted context omitted.

> They use AppArmor extensively as an "application firewall for syscalls", which may sound ugly but is the most practical security solution I've seen in this space. Seems like a good use case for Capsicum[1]. Too bad Capsicum hasn't been merged into the Linux Kernel yet[2]. [1]: https://www.freebsd.org/cgi/man.cgi?capsicum(4) [2]: http://capsicum-linux.org/

Sounds like a good use case for SELinux [0], too, which has already been merged -- roughly 15 years or so ago.

I'm of the impression that SELinux is much more operationally complex than AppArmor--so much so that it lends itself to security holes by way of accidental misconfiguration. This is all hearsay, but I'd like to hear some good discussion about this.

Re: Application Container Security Guide [pdf]

#13
post #9

Earlier quoted context omitted.

AppArmor is probably a good product. Unfortunately, I've been left with a bad taste. MySQL Ubuntu packages pull in AppArmor by default - BY DEFAULT - and include a profile that doesn't let you put your data dir anywhere except for one particular location. And it's virtually impossible to tell why MySQL can write to THAT LOCATION RIGHT THERE where is clearly has the appropriate permissions.

What prevents you from updating the profile?

The error messages you get are NOT helpful in allowing you to figure out what just went wrong, so if you don't know about it there's a huge cognitive gap because things that SHOULD work just don't for no valid reason.

Denials by AppArmor (or any other ACL addition) really should have a more verbose diagnostic message AND a dedicated ERRNO that is different from the standard ones.

Re: Application Container Security Guide [pdf]

#14
post #2

In my experience, multi-tenant Linux container security is still in its infancy due to Docker's unwillingness to build out container security models, the complexity of configuring namespace permissions in the kernel, and the lack of namespace awareness among key driver providers like NVIDIA. The most innovative work I've seen done in this space actually comes from the lxc/lxd group at Canonical, who for many years ha…

Which is yet another reason I've come to like BSD jails.

Re: Application Container Security Guide [pdf]

#15
post #8

Earlier quoted context omitted.

> They use AppArmor extensively as an "application firewall for syscalls", which may sound ugly but is the most practical security solution I've seen in this space. Seems like a good use case for Capsicum[1]. Too bad Capsicum hasn't been merged into the Linux Kernel yet[2]. [1]: https://www.freebsd.org/cgi/man.cgi?capsicum(4) [2]: http://capsicum-linux.org/

Sounds like a good use case for SELinux [0], too, which has already been merged -- roughly 15 years or so ago.

> Sounds like a good use case for SELinux

kinda, although you could implement sandboxing with SELinux it's going to take much more effort. SELinux is a Mandatory Access Control Framework and Capsicum is a hybrid Unix capabilities system. While there is overlap in what you can do with them they really our different sets of tools.

Mandatory access controls are for system administrators to lock down and control access on a machine. Capsicum is for application authors to sandbox their application. Ideally they should be used together.

Back to my point that while MAC(SELinux) can be used for sandboxing but will take more effort then using something like capsicum or pledge. With MAC you have to think of all the things you don't want an application to do. With Capsicum or Pledge you only have to think of the things you want your application to do and everything else will be blocked automatically. So for example to sandbox chromium with capsicum it took 100 LOC, to sandbox chromium with SELinux it took 200 LOC so not bad but it doesn't stop IPC primitives. So half the code and more protection.

[1]: https://www.youtube.com/watch?v=raNx9L4VH2k

Re: Application Container Security Guide [pdf]

#16
post #2

In my experience, multi-tenant Linux container security is still in its infancy due to Docker's unwillingness to build out container security models, the complexity of configuring namespace permissions in the kernel, and the lack of namespace awareness among key driver providers like NVIDIA. The most innovative work I've seen done in this space actually comes from the lxc/lxd group at Canonical, who for many years ha…

Which is yet another reason I've come to like BSD jails.

Yes! Especially when you compile your kernel with VIMAGE and use ZFS as a filesystem. I should imagine that Illumos zones are pretty awesome too because they have the same features and Illumos is the source of ZFS, but unfortunately both my servers motherboards were not supported by SmartOS, so besides for messing around in a VM, I didn't really get do much.

Re: Application Container Security Guide [pdf]

#18
post #13
post #9

Earlier quoted context omitted.

What prevents you from updating the profile?

The error messages you get are NOT helpful in allowing you to figure out what just went wrong, so if you don't know about it there's a huge cognitive gap because things that SHOULD work just don't for no valid reason. Denials by AppArmor (or any other ACL addition) really should have a more verbose diagnostic message AND a dedicated ERRNO that is different from the standard ones.

This can also cause a bunch of fun errors (on installation no less) when you have custom PAM plugins. At least last time I had to deal with that (might have been as long ago as 12.04).

Re: Application Container Security Guide [pdf]

#19
post #2

In my experience, multi-tenant Linux container security is still in its infancy due to Docker's unwillingness to build out container security models, the complexity of configuring namespace permissions in the kernel, and the lack of namespace awareness among key driver providers like NVIDIA. The most innovative work I've seen done in this space actually comes from the lxc/lxd group at Canonical, who for many years ha…

AppArmor is probably a good product. Unfortunately, I've been left with a bad taste. MySQL Ubuntu packages pull in AppArmor by default - BY DEFAULT - and include a profile that doesn't let you put your data dir anywhere except for one particular location. And it's virtually impossible to tell why MySQL can write to THAT LOCATION RIGHT THERE where is clearly has the appropriate permissions.

Isn't that one of the main functions of a Mandatory ACL tool like AppArmor/SELinux - not allowing a program to operate outside of the normal confines?

I'd be happy to know it was working as indented, and a short google would lead you to the answer. In fact, Digital Ocean's documentation is the first result and it's right there in the steps.

Re: Application Container Security Guide [pdf]

#20
post #7
post #2

In my experience, multi-tenant Linux container security is still in its infancy due to Docker's unwillingness to build out container security models, the complexity of configuring namespace permissions in the kernel, and the lack of namespace awareness among key driver providers like NVIDIA. The most innovative work I've seen done in this space actually comes from the lxc/lxd group at Canonical, who for many years ha…

There are a few commercial container security products too - twistlock, aquasec, neuvector - for those who can't wait.

Good news, Clair is an open-source tool and has been there for a few years.
Post reply on HN