VOOZH about

URL: https://thenewstack.io/container-security-101-a-guide-to-safe-and-efficient-operations/

⇱ Container Security 101: A Guide to Safe and Efficient Operations - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2023-04-10 10:00:04
Container Security 101: A Guide to Safe and Efficient Operations
sponsor-cncf,sponsored-post-contributed,
Containers / Operations / Security

Container Security 101: A Guide to Safe and Efficient Operations

Containers are the de facto way of delivering cloud native applications. Here's a guide to the security risks they pose and what countermeasures to take to safeguard them.
Apr 10th, 2023 10:00am by Matteo Bisi
👁 Featued image for: Container Security 101: A Guide to Safe and Efficient Operations
Image via Pixabay.
CNCF sponsored this post.
This post is part of a series that provides a preview of KubeCon + CloudNativeCon Europe 2023, which will be held April 18-21 in Amsterdam. Join us there to learn more about the transformative nature of cloud native applications and open source software.

Over the past few years, container adoption has revolutionized everything. Containers became the de facto standard of software deployments, providing a wide range of advantages such as:

  • Fast deployment
  • Automation
  • Resource isolation
  • Workload portability
  • High scalability
  • Better observability

Before we dive into the technical details, let’s ensure we’re on the same page by giving a brief recap of what containers are in the context of software development.

Containers are system processes (from the host machine perspective) that run with dedicated resources. Now, the next logical question that may arise could be: How are these containers created?

KubeCon + CloudNativeCon conferences gather adopters and technologists to further the education and advancement of cloud native computing. The vendor-neutral events feature domain experts and key maintainers behind popular projects like Kubernetes, Prometheus, Envoy, CoreDNS, containerd and more.
Learn More
The latest from KubeCon + CloudNativeCon

Answering this question leads us forward in understanding the heart of this article’s topics.

Images

Containers are generated from OCI Images that include the elements needed to run an application in a containerized way, such as code, config files, environment variables, libraries, as well as metadata describing its needs and capabilities.

The most common scenario in container generation is developers relying on base images taken from public registries, to which is add the developed software.

There are different types of base images that developers can use; they could be “simple,” like a base OS image, or “complex,” and already contain information like specific system libraries or tools.

Since “the devil is in the details,” so is DevSecOps.

  • Can you really trust and rely on a base image made by someone else?
  • Is it safe to consider “production ready” software based on public images?

It can be challenging to ensure that selected base images will not have any security impact while executed, especially if you rely on “complex” ones.

Security? Yes, Please!

Let’s start from the basics: being aware of the risks is a good starting point to take countermeasures.

There are different sources where developers can pull base images to build their containers, mostly from public registries like:

  • Docker HUB
  • Quay.io
  • Cloud provider registries (Amazon ECR, Azure Container Registry, etc.)

Other common sources are git repositories, where developers can easily find Docker files with the instructions needed for the build.

This is a great example of open source strength, as it enables everyone to build their own images starting from someone else’s work.

The downside is that risks need to be considered when deploying them in production:

  • Malicious code
  • CVEs
  • Bugs
  • Image misconfiguration

Let’s take a deeper look at these and at the easiest best practices developers can implement to avoid them.

👁 Image

Malicious Code

A good way to limit the risk of having an image with malicious code is to pull base images only from an official source or a verified developer.

The well-known public registries have many verified and official developers/companies that push and maintain updated images.

CVEs

All registries taken as example have regular vulnerability scans that provide reports about the current ones being detected.

There is no official repository that can completely solve this issue if the images are not proactively updated with regular scan and patching processes.

Bugs and Image Misconfiguration

Bugs and images misconfiguration could be mitigated using only recent and regularly updated images. For example, from a security perspective on Kubernetes, a good mitigation practice could be an admission webhook that denies the deployment of containers based on images older than a given date.

Risks Involved

At this stage, it should be clear that working with containers and images is a blast, but it needs to be done the right way or at least with awareness.

Over the last few years, unfortunately, many security breaches have been leveraged on a compromised CI/CD supply chain, sometimes driven by malicious code injected into images, sometimes making use of known CVEs.

In the year 2023, DevOps should definitely be aware of these risks and work accordingly with the internal security team to mitigate them.

How to Keep Risks Away? (Container Security Golden Rules)

The picture is now clear. How can we live securely, or at least reduce the risks?

The answer can be long and complicated, and will depend on the level of security required for the production workloads.

Some basic level one rules:

  • Retrieve images only from trusted registries.
  • Use only official images.
  • Check the number of vulnerabilities before considering the use.
  • Fix (at least) the critical vulnerabilities of the images.
  • Use recent images when available.

Another great piece of advice about container images is the minimal, the better.

Using a complete OS as a base container image could be useful for troubleshooting purposes, but more libraries and executables inside the images also means a larger attack surface.

As risk mitigation, DevOps should consider the use of a minimal Linux base image (like Alpine) or a distro-less container image.

Consider, though, that this strategy makes it harder to troubleshoot. Using minimal base images only in a production environment could be a good compromise between security (where it matters most) and troubleshooting during development.

Conclusions

Taking into account the security aspect of base images, keeping them updated and secured over time could be challenging. Usually, relying on trusted sources, verified registries and using updated images can be enough, but this is not always the case.

If a high-security level for the containerized workloads is mandatory, for example finance, insurance or any other high-risk environment, a good idea might be to rely on dedicated services that offer secured, verified and regularly updated images.

The Cloud Native Computing Foundation (CNCF) hosts critical components of the global technology infrastructure including Kubernetes, OpenTelemetry, and Argo. CNCF is the neutral home for cloud native collaboration, bringing together the industry’s top developers, end users, and vendors.
Learn More
The latest from CNCF
TRENDING STORIES
Matteo Bisi is the team leader of the DevSecOps group in SIGHUP. The mission of SIGHUP’s DevSecOps team is to secure the customer infrastructure with a set of best practices and tools, using a shift left approach and the tool...
Read more from Matteo Bisi
CNCF sponsored this post.
SHARE THIS STORY
TRENDING STORIES
Docker is a sponsor of The New Stack.
TNS owner Insight Partners is an investor in: Pragma, Docker, Golden.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.