Securing Containers: Security Testing, API Gateway, Service Mesh and More

Containers are a way to package and distribute software applications. They allow for the isolation of dependencies and system libraries, making it easier to run the application consistently across different environments, such as development, staging, and production.

Container security refers to the measures and practices put in place to protect and secure the software applications and their dependencies running within containers. This can include securing the host operating system, securing the container runtime and orchestration platform, securing the container images, and securing the containerized application itself.

Some common container security measures include:

  • Using only trusted container images from secure repositories
  • Securing network communication within and between containers
  • Isolating containers from host system resources
  • Enforcing least privilege access to the host and container resources
  • Regularly patching and updating the host and container images
  • Implementing security controls such as logging and monitoring
  • Using security scanning tools to detect vulnerabilities in images
  • Implementing security policies and standards for the container environment

It is important to note that container security is an ongoing process and requires constant monitoring and updating to ensure that the containers and the applications running within them remain secure.

Securing Containers in 2023

Security Testing

Security testing is the process of evaluating a system, network or application to identify vulnerabilities, assess the impact of those vulnerabilities, and determine the effectiveness of the security controls in place. It is a way to identify security weaknesses and assess the risk to the system so that appropriate countermeasures can be taken to eliminate or reduce the vulnerabilities.

There are several types of dedicated container security testing tools that can be used to secure containerized environments, including:

  • Image scanning and vulnerability management: These tools scan container images for known vulnerabilities and misconfigurations and provide a way to track and remediate issues.
  • Runtime security: These tools provide security controls for the container runtime environment, such as network segmentation, process isolation and runtime security policies.
  • Secrets management: These tools provide secure storage and management of sensitive data and keys, such as encryption keys, passwords and certificates.

In addition, traditional security testing tools can and should also be used to find vulnerabilities in the applications deployed on containers:

  • Static Application Security Testing (SAST) is a method of analyzing the source code or compiled binaries of an application to identify security vulnerabilities without executing the application. It’s a white-box testing method as it needs access to the source code. SAST can be applied on the source code of the application that runs inside the container and can detect issues such as SQL injection, cross-site scripting (XSS), and insecure coding practices.
  • Dynamic Application Security Testing (DAST) is a method of testing an application by executing it and interacting with it in a controlled environment. It’s a black-box testing method as it doesn’t need access to the source code. DAST can be used to test the running container by simulating an external attack and can detect issues such as unpatched vulnerabilities, misconfigurations and open ports.

API Gateway

APIs are pivotal in the information economy, enabling millions of applications to communicate with one another seamlessly. Thus came the need for the API gateway, middleware that mediates requests between API consumers and upstream services.

Its primary role is to act as a single entry point and standardized process for interactions between an organization’s apps, data and services and internal and external customers. The API gateway can also perform various other functions to support and manage API usage, from authentication to rate limiting to analytics.

An API gateway can help secure containers by acting as a single entry point for all incoming requests to the containerized microservices, and applying security controls such as:

  • Authentication: The API gateway can authenticate incoming requests, ensuring that only authorized users are able to access the containerized microservices.
  • Authorization: The API gateway can authorize incoming requests, ensuring that users are only able to access the resources and operations for which they have permission.
  • Encryption: The API gateway can encrypt the communication between the client and the containerized microservices, ensuring that sensitive data is protected from eavesdropping.
  • Rate limiting: The API gateway can limit the rate at which requests are made to the containerized microservices, protecting them from being overwhelmed by excessive traffic.
  • CORS: The API gateway can handle cross-origin resource sharing (CORS) by returning the appropriate headers to allow or restrict the browser to make cross-origin requests to the containerized microservices.
  • Protection against DDoS: The API Gateway can act as a layer of protection against distributed denial of service (DDoS) attacks by filtering and blocking malicious traffic before it reaches the containerized microservices.

Service Mesh

A service mesh is a configurable infrastructure layer for microservices applications that makes communication between service instances flexible, reliable, and secure. It provides features such as traffic management, service discovery, load balancing and security for microservices running within a containerized environment.

A service mesh can help to secure containerized applications in the following ways:

  • Mutual Transport Layer Security (mTLS) between service instances, which helps to authenticate and encrypt service-to-service communication
  • Role-based access control (RBAC) for service instances, which allows the administrator to set fine-grained access controls for different service instances
  • Automatic sidecar injection, which can be used to automatically deploy security proxies such as Envoy or Istio alongside service instances
  • Traffic management features such as rate limiting, circuit breaking and retries, which can help to prevent and mitigate security issues such as DDoS attacks.
  • Fine-grained visibility and control over the network traffic flowing between services, which allows security teams to monitor, identify and remediate issues effectively.

It is important to note that while a service mesh can help to improve the security of containerized applications, it is not a silver bullet and should be used in conjunction with other security measures such as network segmentation, intrusion detection and incident response.


SASE stands for Secure Access Service Edge. It is an architecture that combines the functionalities of software-defined wide area networking (SD-WAN) and network security (NS) into a single platform. SASE enables organizations to securely connect users, devices, and applications to the cloud and internet, regardless of their location.

SASE helps to improve the overall security and performance of containerized applications by providing a unified and consistent security posture across all locations and network segments, which makes it easier to manage and enforce security policies. SASE can help secure containerized applications by providing:

  • Secure and fast access to the internet and cloud services by using secure and optimized transport methods.
  • Zero-Trust Network Access (ZTNA), which ensures that only authorized users and devices can access the network and resources, regardless of location.
  • Enabling secure communication between services running in different locations, such as different data centers or cloud environments, by using encryption and other security mechanisms.
  • Security features such as firewall, intrusion prevention and VPNs to protect the containerized applications from various types of attacks.
  • Granular visibility and control over all network traffic, which allows security teams to manage security issues centrally.


In conclusion, as the use of containerization continues to grow in popularity, it is crucial for organizations to adopt security measures to protect their containerized applications from various types of threats. Security testing, API gateways, service mesh and SASE are some of the key technologies that can help to secure containerized applications in 2023 and beyond.

However, it’s important to note that container security is an ongoing process and requires constant monitoring and updating to ensure that the containers and the applications running within them remain secure. Organizations should also adopt a holistic approach to security, which includes implementing security best practices, security policies, incident response and other security measures in addition to the technologies mentioned above.

Gilad David Mayaan

Gilad David Maayan is a technology writer who has worked with over 150 technology companies including SAP, Samsung NEXT, NetApp and Imperva, producing technical and thought leadership content that elucidates technical solutions for developers and IT leadership.

Gilad David Mayaan has 30 posts and counting. See all posts by Gilad David Mayaan