Back to All Topics
Deep Dive into Container Security Scanning
At the heart of any image scanning tool is static analysis against a “Common Vulnerabilities and Exposures” (CVE) database. Each layer within the container image is analyzed and queried to discover known vulnerabilities.

Table of Contents
- Answer to What it is?
- Answer to Why it is important?
- What are the factors to keep in mind while selecting the right tool?
- Let's get Implemented.
Answer to What it is?
Audience: Anyone who wishes to deliver secure code to the rest of the world.
Answer to What it is?
At the heart of any image scanning tool is static analysis against a “Common Vulnerabilities and Exposures” (CVE) database. Each layer within the container image is analyzed and queried to discover known vulnerabilities.
In addition to vulnerability scanning, a comprehensive tool should compare the architecture of your application against best practices to identify potential vulnerabilities.
Answer to Why it is important?
While tools like Kubernetes and Container Registries have become household names for developer community because these tools make their life much easier to develop and deploy applications, many are still catching up on the need to integrate container security tools to secure their containerized application throughout the container lifecycle. As the world is already shifted to containerized applications, taking good care of you docker images is also equally important.
One of the main unique features of containers is how layers are used to build a container image. A service is piled up with an application server layer, a Linux layer and so on. One of these layers is updated, we can rebuild the application with a new updated version.
It would be an unthinking idea to get into a container-based strategy without integrating a well-grounded and inclusive container scanning security solution into the CI/CD setup.
What are the factors to keep in mind while selecting the right tool?
-
The CVE database should be up-to-date to any new vulnerability.
-
The tool should give good coverage and should be easy to integrate.
-
Few Image registries like Amazon ECR and Docker Hub, they have it as inbuild container security solution.
Let's get Implemented.
I am here, implementing a Clair tool in gitlab-ci.yml to get secure docker images.
image_scanning: stage: scan image: docker:stable tags: - gitlab-org-docker services: - docker:19.03.8-dind variables: DOCKER_DRIVER: overlay2 allow_failure: true before_script: - echo $CI_BUILD_TOKEN | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY script: - docker run -d --name db arminc/clair-db:latest - docker run -p 6060:6060 --link db:postgres -d --name clair --restart on-failure arminc/clair-local-scan:v2.0.1 - apk add -U wget ca-certificates - docker pull $CI_REGISTRY_IMAGE:$PROJECT_NAME-latest || true - wget https://github.com/arminc/clair-scanner/releases/download/v8/clair-scanner_linux_amd64 - mv clair-scanner_linux_amd64 clair-scanner - chmod +x clair-scanner - touch clair-whitelist.yml - while( ! wget -q -O /dev/null http://docker:6060/v1/namespaces ) ; do sleep 1 ; done - retries=0 - echo "Waiting for clair daemon to start" - while( ! wget -T 10 -q -O /dev/null http://docker:6060/v1/namespaces ) ; do sleep 1 ; echo -n "." ; if [ $retries -eq 10 ] ; then echo " Timeout, aborting." ; exit 1 ; fi ; retries=$(($retries+1)) ; done - ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-container-scanning-report.json -l clair.log -w clair-whitelist.yml $CI_REGISTRY_IMAGE:$PROJECT_NAME-latest || true - cat gl-container-scanning-report.json artifacts: paths: [gl-container-scanning-report.json] rules: - if: '$CI_COMMIT_BRANCH == "staging"' when: always
gitlab-org-docker
is a GitLab shared-runner to run this analysis (an agent on which the above-described job will run), it will fetch the latest ms image and will run it against the CVE database, at last record the report in the JSON file which we can store as artifacts. These artifacts can be further used by the developer to see and resolve the vulnerabilities.

Featured Posts
Javascript tips and tricks to Optimize Performance
3 Simple Ways to Secure Your Websites/Applications
A Bot Protection Overview
A journey from Node to GoLang
AWS Services-Walkthrough
Creating a Web Application using Deno
How to ab-USE CSS2 sibling selectors
Web Workers: How to add multi-threading in JS
Qualities of an agile development team
IoT and AI - The Perfect Match
Ajax and XHR using plain JS
Types of Authentication in Asp.Net
Angular Roster Tutorial
Angular State Management With NGXS
Animate the modal popup using CSS
Implement AntiXssMiddleware in .NET Core Web
Apache Beam: A Basic Guide
API Debugging Tools
What is API Testing? - Discover the Benefits
Guide to Authorization Code Flow for OAuth 2.0
Azure AD as an Identity provider
How to Perform Basic Query Operations in MongoDB
Be More Manipulative with Underscore JS
Beginner's Guide for Sublime Text 3
Beginner's Guide for Sublime Text 3 Plugins
Beginners Guide to Tweepy
Best Hacking Tools
Best Practice Guide For Rest API Security | LoginRadius
Best practice for reviewing QQ app
Best Free UI/UX Design Tools/Resources 2020
Big Data - Testing Strategy
Blockchain: The new technology of trust
Bluetooth Controlled Arduino Car Miniature
Breaking down the 'this' keyword in Javascript
Testing Brute-force Lockout with LoginRadius
Build A Simple CLI Tool using Deno
Build A Twitter Bot Using NodeJS
Build and Push Docker Images with Go
How to Build a PWA in Vanilla JS
How to Build Your Github Profile
Top 9 Challenges Faced by Every QA
NaN in JavaScript: An Essential Guide
Class Activation Mapping in Deep Learning
Cloud Cost Optimization in 2021
Cloud storage vs Traditional storage
Concurrency vs Parallelism: What's the Difference?
Configuring Your Social Sharing Buttons
Deep Dive into Container Security Scanning
Content Security Policy (CSP)
Cookie-based vs. Cookieless Authentication: What’s the Future?
STL Containers & Data Structures in C++
Loading spinner using CSS
Create REST API using deno
Creating a Google Hangout Bot with Express and Node.js
Cross Domain Security
C# Init-Only Setters Property
CSS Responsive Grid, Re-imagined
A Simple CSS3 Accordion Tutorial
CSS3 Responsive Icons
CSS/HTML Animated Dropdown Navigation
Custom Encoders in the Mongo Go Driver
Customize User Login, Register and Forgot Password Page in Drupal 7
Delete a Node, Is Same Tree, Move Zeroes
DESIGN THINKING -A visual approach to understand user’s needs
When Can Developers Get Rid of Password-based Authentication?
IAM, CIAM, and IDaaS - know the difference and terms used for them
Displaying the LoginRadius interface in a pop-up
End-to-End Testing with Jest and Puppeteer
How to create an EC2 Instance in AWS
Why You Need an Effective Cloud Management Platform
ElasticSearch Analyzers for Emails
Integration with electronic identity (eID)
Email Verification API (EVA)
Encryption and Hashing
Enqueuing Scripts in WordPress
How to Use Enum in C#
EOL or End of Line or newline ascii character
EternalBlue: A retrospective on one of the biggest Windows exploits ever
How to Verify Email Addresses in Google Sheet
Exceptions and Exception Handling in C#
4 Ways to Extend CIAM Capabilities of BigCommerce
Extended LinkedIn API Usage
Facebook authentication using NodeJS and PassportJS
Failover Systems and LoginRadius' 99.99% Uptime
Full data science pipeline implementation
How to do Full-Text Search in MongoDB
Get your FREE SSL Certificate!
Getting Started with Phonegap
Getting Started with gRPC - Part 1 Concepts
iOS App Development: How To Make Your First App
How to use Git Cherry Pick
35+ Git Commands List Every Programmer Should Know
How to Perform a Git Force Pull
Git merge vs. Git Rebase: What's the difference?
Introduction to Github APIs
GitHub CLI Tool ⚒
Golang Maps - A Beginner’s Guide
Google OAuth2 Authentication in Golang
Google OAuth2 Authentication in NodeJS - A Guide to Implementing OAuth in Node.js
Add Authentication to Play Framework With OIDC and LoginRadius
Flutter Authentication: Implementing User Signup and Login
How to Authenticate Svelte Apps
Bootstrap 4 vs. Bootstrap 5: What is the Difference?
Build Your First Smart Contract with Ethereum & Solidity
How to Build a Progressive Web App (PWA) with React
How to Implement JWT Authentication for CRUD APIs in Deno
Implement HTTP Streaming with Node.js and Fetch API
How to Implement Registration and Authentication in Django?
Introduction to SolidJS
JWT Authentication — Best Practices and When to Use
How to Authenticate Users: JWT vs. Session
Local Storage vs. Session Storage vs. Cookies
How to Secure Your LoopBack REST API with JWT Authentication
Build a Modern Login/Signup Form with Tailwind CSS and React
Multi-Factor Authentication (MFA) with Redis Cache and OTP
NestJS User Authentication with LoginRadius API
Your Ultimate Guide to Next.js Authentication
Node.js User Authentication Guide
How to Build an OpenCV Web App with Streamlit
32 React Best Practices That Every Programmer Should Follow
How to Implement Role-Based Authentication with React Apps
Using JWT Flask JWT Authentication- A Quick Guide
How to Secure a PHP API Using JWT
NestJS: How to Implement Session-Based User Authentication
11 Tips for Managing Remote Software Engineering Teams
Implementing User Authentication in a Python Application
How to Use Azure Key Vault With an Azure Web App in C#
How to Upgrade Your Vim Skills
What are JWT, JWS, JWE, JWK, and JWA?
What Are Refresh Tokens? When & How to Use Them
GUID Query Through Mongo Shell
Complete Guide to JSON Web Token (JWT) and How It Works
Hacktoberfest 2021: Contribute and Win Swag from LoginRadius
How to Participate in Hacktoberfest as a Maintainer
Handling the Cheapest Fuel- Data
Hello developers and designers!
Hello world with Deno
Benefits and usages of Hosts File
How does bitwise ^ (XOR) work?
How Enum.TryParse() works in C#
How Git Local Repository Works
How to configure the 'Actions on Google' console for Google Assistant
How to create and use the Dictionary in C#
How to Get Email Alerts for Unhandled PHP Exceptions
Maintain Test Cases in Excel Sheets
How to make a telegram bot
What is a DDoS Attack and How to Mitigate it
How to obtain iOS application logs without Mac
How to Promise
How to send emails in C#/.NET using SMTP
Install Bootstrap with Bower
jCenter Dependencies in Android Studio
Maven Dependency in Eclipse
HTML Email Concept
HTML5 Limitation in Internet Explorer
HTTP Security Headers
How Chrome’s Third-Party Cookie Restrictions Affect User Authentication?
Why B2B Companies Should Implement Identity Management
Image Colorizer Tool - Kolorizer
Implement Authentication in React Applications using LoginRadius CLI
How to Implement Facebook Social Login
Implement Authentication in Angular 2+ application using LoginRadius CLI in 5 mins
Implementing Authentication on Vue.js using JWTtoken
How to Implement OpenID Connect (OIDC) SSO with LoginRadius?
Why RPA is important for businesses
Why Implement Search Functionality for Your Websites
Index in MongoDB
How to Integrate Invisible reCAPTCHA for Bot Protection
Integrating LinkedIn Social Login on a Website
An Intro to Curl & Fsockopen
Introducing LoginRadius CLI
Introduction of Idx-Auto-Tester
Introduction to Android Studio
Introduction to Cross-Site Request Forgery (CSRF)
Introduction to Redux Saga
Introduction to UniFi Ubiquiti Network
Introduction to Web Accessibility with Semantic HTML5
Invalidating JSON Web Tokens
Is Your Database Secured? Think Again
How to Install and Configure Istio
Istio Service Mesh: A Beginners Guide
Introduction to JAMstack
JavaScript Events: Bubbling, Capturing, and Propagation
What is JSON Web Token
How to create and validate JSON Web Tokens in Deno
JWT Signing Algorithms
Lazy loading in React
Virtual Dispersive Networking
Learn How To Code Using The 10 Cool Websites
Learning How to Code
Let's Encrypt with SSL Certificates
Let’s Take A MEME Break!!!
LinkedIn Login using Node JS and passport
How to Create List in C#
How to Migrate Data In MongoDB
How to implement Facebook Login
LoginRadius Launches a CLI for Enterprise Dashboard
LoginRadius Open Source For Hacktoberfest 2020
One Vision, Many Paths: How We’re Supporting freeCodeCamp
LoginRadius Supports Hacktoberfest 2020
Login Screen - Tips and Ideas for Testing
Memcached Memory Management
Using MongoDB as Datasource in GoLang
Hi, My Name is Darryl, and This is How I Work
Nim Game, Add Digits, Maximum Depth of Binary Tree
NodeJS Server using Core HTTP Module
Node Package Manager (NPM)
NodeJS and MongoDB application authentication by JWT
How to Work with Nullable Types in C#
OAuth implementation with Node.js and Github
Getting Started with OAuth 2.0
How Lapsus$ Breached Okta and What Organizations Should Learn
Open Source Business Email Validator By Loginradius
Automation for Identity Experience Framework is now open-source !!!
Optimal clusters for KMeans Algorithm
Optimize jQuery & Sizzle Element Selector
Part 2 - Creating a Custom Login Form
Password hashing with NodeJS
Password Security
Password Security Best Practices & Compliance
Personal Branding For Developers: Why and How?
PKCE: What it is and how to use it with OAuth 2.0
Production Grade Development using Docker-Compose
PWA vs Native App: Which one is Better for you?
Python basics in minutes
Python Virtual Environment: What is it and how it works?
QA Testing Process: How to Deliver Quality Software
Setting Up and Running Apache Kafka on Windows OS
A Quick Look at the React Speech Recognition Hook
Code spliting in React via lazy and suspense
Constructor vs getInitialState in React
React Context API: What is it and How it works?
React's Context API Guide with Example
React Error Boundaries
React Hooks: A Beginners Guide
React renderers, react everywhere?
React Router Basics: Routing in a Single-page Application
React Security Vulnerabilities and How to Fix/Prevent Them
React state management: What is it and why to use it?
React with Ref
React's Reconciliation Algorithm
Read and Write in a local file with Deno
What is recoil.js and how it is managing in react?
RDBMS vs NoSQL
Automating Rest API's using Cucumber and Java
How to Deploy a REST API in Kubernetes
What is Risk-Based Authentication? And Why Should You Implement It?
Roadmap of idx-auto-tester
Single-Tenant vs. Multi-Tenant: Which SaaS Architecture is better for Your Business?
SDK Version 10.0.0
Secure Enclave in iOS App
Self-Hosted MongoDB
Different ways to send an email with Golang
Separate Drupal Login Page for Admin and User
Top 4 Serverless Computing Platforms in 2021
Service Mesh with Envoy
Setup a blog in minutes with Jekyll & Github
Shopify Embedded App
Optimize Your Sign Up Page By Going Passwordless
A Simple Popup Tutorial
Social Media Solutions
Breaking Down the Decision: Why We Chose AWS ElastiCache Over Redis Cloud
Snapshot testing using Nightwatch and mocha
Social Media Colors in Hex
Social Network Branding Guidelines
Social Provider Social Sharing Troubleshooting Resources
The Upcoming Future of Software Testers and SDETs in 2021
Sonarqube: What it is and why to use it?
Speed Up Python Code
How to add SSO for your WordPress Site!
StackExchange - The 8 best resources every developer must follow
Kafka Streams: A stream processing guide
Styling Radio and Check buttons with CSS
The truth about CSS preprocessors and how they can help you
Know The Types of Website Popups and How to Create Them
Three Ways to do CRUD Operations On Redis
Top 10 Cyber Threats in 2022
Traversing the realms of Quantum Network
How to Use the HTTP Client in GO To Enhance Performance
Twitter authentication with Go Language and Goth
Understanding event loop in JavaScript
Understanding JSONP
What is Kubernetes? - A Basic Guide
How to Render React with optimization
Unit Testing: What is it and why do you need it?
Upload files using NodeJS + Multer
Use PHP to generate filter portfolio
A Guide To React User Authentication with LoginRadius
Data Masking In Nginx Logs For User Data Privacy And Compliance
Using Facebook Graph API After Login
How to Use JWT with OAuth
M2M Authorization: Authenticate Apps, APIs, and Web Services
Using NuGet to publish .NET packages
Using PGP Encryption with Nodejs
Vim: What is it and Why to use it?
Visualizing Data using Leaflet and Netlify
W3C Validation: What is it and why to use it?
Web Workers in JS - An Introductory Guide
WebAuthn: A Guide To Authenticate Your Application
Website Authentication Protocols
What is Adaptive Authentication or Risk-based Authentication?
What is an API
Cocoapods : What It Is And How To Install?
What is GraphQL? - A Basic Guide
A comprehensive guide to OAuth 2.0
OAuth 1.0 VS OAuth 2.0
What's new in the go 1.15
The Importance of Multi-Factor Authentication (MFA)
Why We Re-engineered LoginRadius APIs with Go?
Wordpress Custom Login Form Part 1
Working with AWS Lambda and SQS
Write a highly efficient python Web Crawler
Let's Write a JavaScript Library in ES6 using Webpack and Babel