Threat: Malicious Base Image
- Description: An attacker publishes a malicious base container image on a registry. Users unknowingly pull and use this image. The attacker embedded malware, backdoors, or vulnerabilities within. Upon container startup, malicious code executes, compromising the container and potentially the host.
- Impact: Container compromise, malware infection, data theft, potential host system compromise, supply chain attack.
- Podman Component Affected: Image Pull, Image Storage, Container Runtime (via image execution).
- Risk Severity: High
- Mitigation Strategies:
- Verify Image Source: Only use base images from trusted and reputable registries.
- Image Scanning: Implement automated image scanning before deploying containers.
- Image Signing and Verification: Utilize image signing and verification mechanisms.
- Minimal Base Images: Use minimal base images to reduce the attack surface.
Threat: Leaked Secrets in Image Layers
- Description: Developers accidentally include sensitive information (API keys, passwords, certificates) in Dockerfiles or during image build. Secrets become part of image layers and are persistently stored. An attacker gaining access to the image can extract these secrets.
- Impact: Exposure of sensitive credentials, unauthorized access to systems and data, potential data breaches, account takeover.
- Podman Component Affected: Image Build, Image Storage, Dockerfile Processing.
- Risk Severity: High
- Mitigation Strategies:
- Avoid Embedding Secrets in Dockerfiles: Never hardcode secrets directly.
- Use Secret Management: Implement secure secret management solutions to inject secrets at container runtime.
- Multi-Stage Builds: Utilize multi-stage Docker builds to separate build-time dependencies and secrets.
.dockerignore
File: Use.dockerignore
to exclude sensitive files from the image context.- Secret Scanning: Implement automated secret scanning tools.
- Description: An attacker exploits a vulnerability in the container runtime (runc, crun) or the kernel. This allows breaking out of container isolation and gaining access to the host OS. The attacker can then control the host, access sensitive data, or pivot to other containers.
- Impact: Full host system compromise, privilege escalation, data breaches, lateral movement, denial of service.
- Podman Component Affected: Container Runtime (runc/crun), Kernel.
- Risk Severity: Critical
- Mitigation Strategies:
- Keep Podman and Runtime Updated: Regularly update Podman and the runtime to patch vulnerabilities.
- Kernel Updates: Keep the host kernel updated with security patches.
- Security Profiles (SELinux/AppArmor): Enforce security profiles to restrict container capabilities.
- Minimal Container Privileges: Run containers with least privileges, use Podman's rootless mode.
- Capability Dropping: Drop unnecessary Linux capabilities using
--cap-drop
.
- Description: Running containers in privileged mode (
--privileged
) disables security features and gives containers almost full host access. An attacker exploiting a vulnerability in a privileged container can easily escalate privileges and compromise the host. - Impact: Full host system compromise, privilege escalation, data breaches, lateral movement.
- Podman Component Affected: Container Configuration, Container Runtime.
- Risk Severity: Critical
- Mitigation Strategies:
- Avoid Privileged Mode: Never run containers in privileged mode unless absolutely necessary and with extreme caution.
- Capability Management: Instead of privileged mode, add only necessary Linux capabilities using
--cap-add
. - Security Profiles: Utilize security profiles even for containers needing some elevated privileges.
- Regular Security Audits: Regularly audit container configurations for unnecessary privileged mode usage.
Threat: Unsecured Local API Exposure
- Description: If the Podman API is exposed locally without proper authentication and authorization, an attacker gaining local system access can interact with the API. This allows control over containers, images, and potentially actions with the privileges of the user running Podman.
- Impact: Full control over container infrastructure, data breaches, denial of service, potential privilege escalation.
- Podman Component Affected: Podman API, Local Socket Communication.
- Risk Severity: High
- Mitigation Strategies:
- Restrict API Access: If needed, restrict API access using authentication and authorization. Avoid unnecessary exposure.
- TLS Encryption for API: Use TLS encryption for API communication if exposed over a network.
- Minimize API Exposure: Only enable the API if required, disable it if not needed.
- Podman Remote Client: Consider using Podman's remote client instead of directly exposing the API socket.
Threat: Storage Driver Vulnerability
- Description: Vulnerabilities in the container storage driver (overlay, vfs, etc.) could be exploited. This could allow unauthorized access to container data, host filesystem manipulation, or container escape.
- Impact: Data breaches, container escape, host system compromise, data corruption.
- Podman Component Affected: Storage Driver (overlay, vfs, etc.), Image Storage, Container Filesystem.
- Risk Severity: High
- Mitigation Strategies:
- Keep Podman and Storage Driver Updated: Regularly update Podman and storage driver components.
- Choose Stable Storage Driver: Select a stable and well-maintained storage driver.
- Storage Driver Security Features: Utilize security features offered by storage drivers, like encryption at rest.
- Regular Security Audits: Periodically audit storage driver configuration.
- Description: An attacker could exploit vulnerabilities in Podman's container networking or the network stack to bypass network isolation. This allows a container to access restricted networks or services, leading to unauthorized access or lateral movement.
- Impact: Unauthorized access to internal networks, lateral movement, data breaches, network compromise.
- Podman Component Affected: Container Networking (CNI plugins, network stack), Network Configuration.
- Risk Severity: High
- Mitigation Strategies:
- Use Appropriate Network Modes: Choose container network modes and network policies to enforce isolation.
- Avoid Host Networking: Avoid host networking mode (
--net=host
) unless absolutely necessary. - Network Segmentation and Firewalls: Implement network segmentation and firewalls to isolate container networks.
- Network Policies: Utilize network policies to define granular network access rules.
- Keep Networking Components Updated: Ensure Podman's networking components and network stack are updated.
- Description: Using Podman extensions or plugins, especially from untrusted sources, a malicious extension could introduce vulnerabilities or backdoors. A malicious plugin could access Podman's internals, manipulate containers, or compromise the host.
- Impact: Depends on plugin functionality, could range from information disclosure, container manipulation, to container escape or host system compromise.
- Podman Component Affected: Podman Extension/Plugin System.
- Risk Severity: High
- Mitigation Strategies:
- Trusted Extension Sources: Only use extensions from trusted and reputable sources.
- Extension Security Review: Review extension documentation, permissions, and functionality before installing.
- Minimal Extension Usage: Only install necessary extensions to minimize the attack surface.
- Extension Updates: Keep installed extensions updated.