- Cloud Native Applications
- Application Security
- Application Security
- Web Application Security
- Application Security Posture Management (ASPM)
- Microsegmentation
- Python Security
- SaaS Security
- Node.JS Security
- PHP Security
- AI in Cyber Security
- Cybersecurity for Financial Services
- The Principle of Least Privilege (PoLP)
- Identity and Access Management
- Cybersecurity in Banking
- Threat Detection and Response
- Cyber Kill Chain
- Threat Hunting
- Zero Trust Security
- Zero Trust Architecture
- Fileless Attacks
- DSPM
- Container Scanning
- Kubernetes
- Kubernetes
- Kubernetes Alternatives
- Kubernetes Namespace
- Kubernetes Architecture
- Kubernetes Cluster
- Kubernetes Nodes
- Kubernetes Pods
- Kubernetes Jobs
- Kubernetes Workloads
- Kubernetes Monitoring
- Kubernetes Security
- Kubernetes RBAC
- Secret Scanning
- Kubernetes Security Posture Management (KSPM)
- Kubernetes on AWS
- Kubernetes on VMware
- Kubernetes Vulnerability Scanning
- Managing Containers in Kubernetes
- K3s
- eBPF in Kubernetes
- Kubernetes Dashboard
- Kubernetes Operators
- Kubernetes Services
- Kubernetes Devops
- Kubernetes Networking
- Kubernetes ConfigMap
- Kubernetes Management
- Kubernetes Helm
- Kubernetes as a Service
- Kubernetes Serverless
- Kubernetes Tutorials
- Cloud Attacks
- Cloud Attacks
- Malware Attacks
- Zero Day Attack
- Top 10 Cyber Security Threats
- Arbitrary Code Execution
- Cryptojacking
- AI Attacks
- Prompt Injection
- Backdoor Attacks
- Reverse Shell Attack
- Remote Code Execution
- Defense Evasion
- Honeypots in Cybersecurity
- Malware Analysis
- AI Malware
- Lateral Movement
- Advanced Malware Protection
- CNAPP
- AI Security
- Container Platforms
- Containerized Architecture
- Containerized Architecture
- Docker Secrets
- Container Runtime Interface
- Container Images
- Image Scanning
- Container Compliance
- Docker Security Best Practices
- Container Security
- Container Security Best Practices
- Container Security Tools
- ECS Security
- Network Segmentation
- Istio security
- runC
- Service Mesh
- Image Repository
- Container Escape
- Container Runtime
- Docker Container
- OSS Container Image Scanning Tools
- What Is a Container?
- Docker Images
- Containerization 101
- VM vs. Container
- Containerization vs. Virtualization
- Containerized Applications
- Microservices and Containerization
- Registry Scanning
- Docker CVEs
- Docker Monitoring
- Securing Containers with Docker Scanning
- Docker CIS Benchmark
- Seccomp
- Docker Alpine
- Docker API
- Docker Tools
- 100 Best Docker Tutorials
- Docker Alternatives
- Docker Swarm
- Docker Containers vs. Virtual Machines (VMs)
- Docker Architecture
- Docker Networking
- Docker Registries
- Docker Orchestration
- OpenShift vs Docker
- Container Cloud Computing
- Container DevOps
- Docker in Production
- Container Monitoring
- Container Advantages
- Docker Hub
- Serverless Architecture
- Supply Chain Security
- Supply Chain Compliance
- SolarWinds Attack
- Supply Chain Security
- Secure Software Development Lifecycle
- Software Supply Chain Attacks
- Dependency Confusion Attack
- SLSA
- SSDF
- Software Composition Analysis
- Security Misconfigurations
- Repojacking
- Privilege Escalation
- CI/CD Security
- SAST Security
- GitLab Security
- GitHub Secret Scanning
- OWASP Dependency-Check
- Software Bill of Materials
- SBOM Tools
- NPM Vulnerabilities
- Log4j Vulnerability
- Text4Shell
- Secrets Management
- Jenkins Security
- Yarn vs. NPM
- Source Code Leaks
- Container Image Signing
- Open Source Licenses
- Vulnerability Management
- Vulnerability Management Tools
- Vulnerability Scanning Process
- Vulnerability Management
- Vulnerability Scanning
- Vulnerability Prioritization
- Open Source Vulnerability Scanning
- Vulnerability Remediation
- Vulnerability Scanner
- Risk-Based Vulnerability Management
- Vulnerability Exploitability eXchange (VEX)
- Malware Detection
- Fileless Malware
- Attack Vectors
- Malicious Code
- Risk Posture
- Alert Fatigue in Cybersecurity
- Cyber Security Posture
- MITRE ATT&CK
- MITRE ATT&CK Framework
- LLM Security
- Code Scanning
- Attack Surface
- Attack Surface Management
- What Are Indicators of Compromise (IoC)?
- Secure Code
- Configuration Drift
- Trivy
- DevSecOps
- DevSecOps
- DevSecOps Pipeline
- DevSecOps Best Practices
- DevSecOps vs SecDevOps
- Threat Modeling
- Mean Time to Repair (MTTR)
- eBPF Linux
- Cloud DevOps
- DevOps Tools
- GitOps vs DevOps
- Code Security
- Secure Code Review
- DevOps Security
- Infrastructure as Code (IaC) Security
- Infrastructure as Code DevOps
- Executive Order 14028 (U.S. Cybersecurity Executive Order)
- Open Source Security
- Shift-Left Security
- Shift Right Testing and Security
- What Is SecOps (Security Operations)?
- SecDevOps
- DevSecOps Tools
- Linux Security
- Rocky Linux
- Azure DevOps
- Cloud Security
- Cloud Security
- Cloud Security Challenges
- Cloud Security Tools
- Code to Cloud
- Cloud Protection
- Cloud Security Frameworks
- Cloud Security Standards
- Cloud Security Controls
- Cloud Security Posture Management (CSPM)
- AI Workloads
- Cloud Digital Forensics
- Cloud Computing Security Architecture
- What Is Enterprise Cloud Security?
- Virtualized Security
- CSPM Tools
- Vulnerabilities in Cloud Computing
- Top 7 Risks of Cloud Computing
- Cloud Security Assessment
- Cloud Visibility
- Cloud Governance
- Cloud Security Strategy
- Cloud Security Policy
- DFIR
- Cloud Workloads
- Public Cloud Security
- Private Cloud vs. Public Cloud
- Runtime Security
- Azure Cloud Security
- Azure Security Best Practices
- Azure Security vs. AWS Security
- AWS GovCloud: Basics & How It Compares to Azure & GCP
- S3 Security
- Cloud Misconfiguration
- Terraform Security
- Hybrid Cloud Security
- Multi-Cloud Strategy
- Agentless vs. Agent-Based Security & Monitoring
- Cloud Infrastructure Security
- Gartner CSPM
- Cloud Security Scanner
- AWS CIS Benchmark
- Cloud Configuration Management
- Cloud Workload Protection (CWP)
- Cloud Workload Protection Platforms (CWPP)
- Cloud Workload Security
- Cloud Vulnerabilities and Tools that Can Help
- Google Cloud Security
- Shared Responsibility Model
- AWS Shared Responsibility Model
- AWS Cloud Security
- Multi Cloud Security
- Cloud Compliance
- Kubernetes in Production
- Cloud Detection And Response
Container Image Signing: A Practical Guide
Container image signing is the process of adding a digital signature to a container image, to ensure its authenticity and integrity.
What Is Image Signing?
Container images are an important part of the containerized application development process, as they allow applications to be packaged and deployed consistently across different environments, without the need to worry about dependencies or configuration.
Container image signing is the process of adding a digital signature to a container image, to ensure its authenticity and integrity. The signature is used to verify that the image has not been tampered with or modified in any way, and that it is the same image that was originally signed.
There are several ways to sign container images, including using private/public key pairs, and using trusted third-party certificate authorities. The most common method is to use a private/public key pair, where the private key is used to sign the image, and the public key is used to verify the signature.
Using this method, the user creates a private/public key pair and stores the private key in a secure location. The user then uses the private key to sign the image, and adds the signature and the public key to the image. When the image is run, the container runtime can verify the signature using the public key, to ensure that the image has not been tampered with.
This is part of a series of articles about supply chain security.
In this article:
The Need for Container Image Signing
Trust is a major concern for containers. Container image signing allows users to add a digital “fingerprint” to an image. This fingerprint can later be cryptographically tested to verify trust. This allows users of container images to verify origin and trust the content included in container images.
Containers package code, binaries, and libraries into an image. Once the image is ready, it can be uploaded to a container registry and shared with others. When the image is shared, it is essentially anonymous—it is difficult to verify the content inside or its source without cryptographic signatures.
To make matters worse, container images are often made up of layers of images controlled by multiple people and teams. This makes it even more difficult to ascertain what exactly was included in each layer of the image.
The main goal for end-users of container images is to verify the chain of custody (CoC). They must establish a trust relationship with any team that added files to the container image. All layers of a container image must be trusted by end users—otherwise using the container image represents a security risk.
What Is a Cryptographic Signature?
A cryptographic signature is a digital code that is generated using a private key, and is used to authenticate the identity of the person or entity that created the signature. Cryptographic signatures are used to ensure the integrity and authenticity of digital documents, messages, and other types of data.
Cryptographic signatures use a process called asymmetric encryption, which involves the use of two keys: a private key, which is kept secret, and a public key, which is made available to others. When a user wants to sign a document, they use their private key to create a digital signature, which is a unique code that is based on the content of the document. The signature can then be verified using the user’s public key.
Cryptographic signatures are used for a variety of purposes, including authenticating the identity of the sender of a message, ensuring the integrity of a message or document, and providing non-repudiation (proof that the sender cannot deny having sent the message). They are an important security feature in many applications, including email, digital certificates, and financial transactions.
In the signature verification process, the hash of the document or message is calculated and compared to the hash that is included in the signature. If the hashes match, it indicates that the document or message has not been tampered with, and that it is the same as the original document or message.
Hashing is an important security feature, as it allows the authenticity and integrity of a document or message to be verified without needing to store or transmit the entire document or message. In some cases, a timestamp might be used to indicate when the signature was created.
It is possible for a container image to have multiple signatures, either from the same signer or from multiple signers. This can be useful in a variety of situations, such as when multiple parties need to sign the image to verify its authenticity and integrity, or when the image needs to be signed multiple times to meet different security requirements.
Steps to Create Image Signatures
Here is one way to automatically create image signatures—the process may differ depending on your tools, such as the container registry and orchestrator.
- Generate a private/public key pair: The first step in creating an image signature is to generate a private/public key pair. The private key is kept secret, and is used to sign the image. The public key is made available to others, and is used to verify the signature.
- Build the container image: The next step is to build the container image. You will need to create a Dockerfile, which is a text file that contains instructions for building the image.
- Sign the image: Once the image is built, you can use your private key to sign the image. To sign the image, you will need to use a command-line tool or API provided by the container runtime or image registry. For example, in Docker, you can use the docker trust command to sign the image.
- Share the signature store: After the image is signed, you will need to share the signature store with the appropriate parties. The signature store is a location where the signatures and corresponding public keys are stored. This could be a central location, such as a secure server, or it could be distributed across multiple locations.
- Validate the signature: To validate the signature of the image, you will need to use the public key that corresponds to the private key used to sign the image. The public key can be used to verify the signature at runtime, to ensure that the image has not been tampered with or modified in any way. You can use a command-line tool or API provided by the container runtime or image registry to perform the validation.
How to Verify Signed Container Images in Kubernetes
To verify signed container images in Kubernetes, you will need to use the kubectl command-line tool and the Kubernetes API. Here are the steps to verify signed container images in Kubernetes:
1. Fetch the public keys for the signatures
The first step is to fetch the public keys for the signatures. The public keys are used to verify the signatures of the container images. You can use the kubectl get secrets command to fetch the public keys from a secret store, such as a Kubernetes secret or a ConfigMap. Here is an example:
kubectl get secrets -n mynamespace mysecret -o yaml
This command will fetch the secret named mysecret from the namespace mynamespace, and output the secret in YAML format. The secret should contain the public keys for the signatures.
2. Verify the signatures of the container images
Once you have the public keys, you can use the kubectl command-line tool and the Kubernetes API to verify the signatures of the container images. To do this, you will need to use the kubectl command to retrieve the image from the container registry, and then use the openssl command-line tool to verify the signature using the public key. Here is an example:
kubectl get pod mypod -o jsonpath='{.spec.containers[*].image}’ | xargs -I {} bash -c “openssl dgst -sha256 -verify public.pem -signature {}.sig {}”
This command will retrieve the image for the pod named mypod, and use the openssl command to verify the signature using the public key stored in the file public.pem. If the signature is valid, the command will output “Verified OK”. If the signature is invalid, the command will output an error message.
- Supply Chain Compliance: 4 Standards You Should Know
- SolarWinds Attack: Play by Play and Lessons Learned
- Supply Chain Security: Mitigating the Supply Chain Threat
- What Is the Secure Software Development Lifecycle (SSDLC)?
- Software Supply Chain Attacks: 6 Examples and 6 Defensive Strategies
- Dependency Confusion Attack
- What Is SLSA and How to Use it for Supply Chain Security
- What Is SSDF (Secure Software Development Framework)?
- What Is Software Composition Analysis (SCA)?
- Security Misconfiguration: Types, Examples & Prevention Tips
- Why Repojacking Is a New Mega Threat & Protecting Your Projects
- Privilege Escalation in Windows, Linux, and K8s and 6 Ways to Prevent It
- CI/CD Security: Threats, Tools, and Best Practices
- SAST Security: Is SAST Still Relevant for Modern Applications?
- GitLab Security
- GitHub Secret Scanning
- How to Analyze the OWASP Dependency-Check?
- SBOM (Software Bill of Materials)
- What Are SBOM Tools?
- 6 Common npm Vulnerabilities and How to Fix Them
- Log4j Vulnerability: Updated Info and Protection for 2023
- Text4Shell CVE (CVE-2022-42889): Impact and Fixes
- What Is Secrets Management? Challenges and Best Practices
- Jenkins Security: How it Works & Best practices
- Yarn vs. NPM: Which Package Manager You Should Choose, and Why?
- Source Code Leaks: How to Avoid Them Before They Happen
- 5 Open Source Licenses and Compliance Risks to Know About
- Show more
Aqua Cloud Native Application Protection Platform (CNAPP)
Go cloud native with the experts!