Securing and monitoring containers in enterprise environments
Did You Lock the Front Door?
You might have heard of Secure Computing Mode (known as seccomp), with which you enforce a limit on a process' abilities or on syscalls that are needed for a process to request a service from the kernel. The addition of these profiles is also possible in Kubernetes [5], currently the most popular container orchestration engine with an impressive 15-year production provenance from Google.
Creating a seccomp profile allows you to define every available syscall in a list, and after lots of testing at Google, you can take some comfort in the knowledge that the default profiles that enforce these tricky-to-fathom limits will help keep most applications available and not break anything horribly.
From a Docker perspective, a number of syscalls are run by default, but many are also switched off. At one point, their default profile blocked more than 50 syscalls with the promise that things would keep running as expected.
Want to Eat Your Cake Too?
In addition to fine-grained seccomp profiling, Docker cleverly integrates with the kernel's capabilities [6].
How to switch on only the permissions you require and not get bamboozled with the need to allow cap-add=all
, which opens the floodgates to the host on which a container runs, is definitely worth understanding. I find myself referring to Linux capabilities [7] continually these days.
Be warned, however, that even worse than opening up lots of kernel capabilities for your containers is the dreaded (and I've heard it called "lazy") privileged mode. With privileged containers, in addition to unleashing system capabilities with cap-all=all
, you lose all the limitations enforced by the device cgroups controller.
In terms of protecting your host from a container running in privileged mode, you might say that you're effectively leaving your front door swinging open in the wind, never mind forgetting to lock it.
As for the future of host security, it's common knowledge that Google has been working hard at spawning containers as the non-root user (and the Gnome project apparently has, too, from a desktop perspective). By all accounts, however, it's not a trivial undertaking. In case you are wondering, the popular Google Chrome browser sandboxes its Browser tabs in a not too dissimilar (and very clever) way that containers run. The surprising crossover between desktop and container spaces shows how important fine-grained kernel access for processes is.
The future is sharing VMs between distinct tenants (different customers) with fully assured safety and little fear of a compromise taking down your entire customer base at once. Kubernetes itself is not far from orchestrating containers within hypervisors for safety.
Freedom of Choice
One change that might have crept in under your radar, among those sometimes difficult-to-follow changes in the industry I mentioned earlier, is that Kubernetes has moved to allowing you to state your container runtime of choice.
Kubernetes reminds you that there's more than one way to launch a container – namely, using the cri=
switch (i.e., for the container run-time interface, CRI). The CRI means you are no longer tied to the Docker runtime but can choose other run-time engines, such as rkt
or the soon to be a la mode runtime that will comply with OCI standards (i.e., cri-o
).
Conveniently, the container network interface (CNI) improvements also integrate nicely with the chosen container runtime's networking in Kubernetes. The project's page can be seen on GitHub [8].
Although easy to miss, progress is well underway on other lesser known projects to bestow more run-time choice. You might have a look at the README files for rktlet
[9] and frakti
[10] on their respective GitHub sites.
I recommend having a quick read of both pages for some valuable insight into what you might be working with very soon. Each choice is sophisticated and ultimately could have different agendas.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
News
-
KaOS 2022.06 Now Available With KDE Plasma 5.25
The newest iteration of KaOS Linux not only adds the latest KDE Plasma desktop but sets LibreOffice as the default.
-
Manjaro 21.3.0 Is Now Available
Manjaro “Ruah” has been released and includes the latest Calamares installer, GNOME 42, and much more.
-
SpiralLinux is a New Linux Distribution Focused on Simplicity
A new Linux distribution, from the creator of GeckoLinux, is a Debian-based operating system with a focus on simplicity and ease of use.
-
HP Dev One Linux Laptop is Now Available for Pre-Order
The System76/HP collaboration Dev One laptop, geared toward developers, is now available for pre-order.
-
NixOS 22.5 Is Now Available
The latest release of NixOS with a much-improved package manager and a user-friendly graphical installer.
-
System76 Teams up with HP to Create the Dev One Laptop
HP and System76 have come together to develop a new laptop, powered by Pop!_OS and aimed toward developers.
-
Titan Linux is a New KDE Linux Based on Debian Stable
Titan Linux is a new Debian-based Linux distribution that features the KDE Plasma desktop with a focus on usability and performance.
-
Danielle Foré Has an Update for elementary OS 7
Now that Ubuntu 22.04 has been released, the team behind elementary OS is preparing for the upcoming 7.0 release.
-
Linux New Media Launches Open Source JobHub
New job website focuses on connecting technical and non-technical professionals with organizations in open source.
-
Ubuntu Cinnamon 22.04 Now Available
Ubuntu Cinnamon 22.04 has been released with all the additions from upstream as well as other features and improvements.