DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Container Images Compliance: Removing Security Pain Points With ManageIQ and OpenSCAP

Container Images Compliance: Removing Security Pain Points With ManageIQ and OpenSCAP

Can we trust developers to use only good packages? In container-based dev flows, we want to ensure that images are compliant... but how do we even define compliance? Using ManageIQ’s Smart State Analysis as a means of automating Cloud and Container based workflows and OpenSCAP as a means of of measuring compliance, we'll show one way to solve this problem.

Mooli Tayer user avatar by
Mooli Tayer
·
Mar. 08, 17 · Tutorial
Like (1)
Save
Tweet
Share
4.14K Views

Join the DZone community and get the full member experience.

Join For Free
"Docker is about running random crap from the Internet as root on your host" - Dan Walsh

Do You Trust Your Containers?

In container-based development flows, a developer will create an image to be the base for an application. Images are stateless, read only, and they are built in layers. These layers represent everything in an application's runtime environment but the kernel, which will be “borrowed” from the hosting machine. Such layers include distribution, packages, environment, and additional configurations. It is not uncommon to see images on the Docker hub using wget to grab random stuff off the Internet to make up some of these layers.

This represents a paradigm shift over the pre-container world where there was a clearer line between developers writing application code and IT specialists taking care of package upgrades. Can we trust developers to use only good packages? When the next Heartbleed is discovered will there be someone monitoring CVE streams to make sure packages are updated in a timely manner? What if the developer leaves the company?

One solution is to use a container registry from a trusted authority. Red Hat's container registry, for example, provides secure base images and removes the above-mentioned concern. However, in order to have containerized applications with any value, a developer must create his own Images on top and distribute them somehow.

How can we check a given Image for compliance?

How do we even define such compliance?

Introductions to OpenSCAP and ManageIQ

ManageIQ, the open source project that powers Red Hat's CloudForms, is a hybrid cloud management platform.

Image title

Cloud management platforms are used by organizations to control complex environments composed of nodes coming from multiple sources including traditional virtualization, private and public clouds, containers, and much more. ManageIQ supports container providers including OpenShift and Kubernetes.

OpenSCAP is free software Implementation of SCAP: The Security Content Automation Protocol.

SCAP is a NIST authored set of standards. Combined together, these standards allow for:

  • Naming systems components such as Operating Systems, Packages, and configurations.
  • Defining possible Vulnerabilities (CVE) and Weaknesses (CWE) against those systems.
  • Defining checklists (‘Content’) on systems against Vulnerabilities and Weaknesses.

With these components and content from a trusted source, we can now look at one system or a complete environment and say if they are compliant or not.

SCAP is trusted & used by many organizations including the US government & military.

Image title

Thus far, we've mentioned a pain point in Container based environments, introduced SCAP as a means to measure compliance in computer systems, and presented ManageIQ as a means of automating Cloud & Container based workflows.

Now, we will demo using ManageIQ’s Smart State Analysis to introspect container images and view SCAP results for them. We will then go further, and use the Control subsystem of ManageIQ, see how the system can monitor compliance for us, and even take authoritative action when a predefined baseline is not met.

Tutorial: Using the OpenSCAP Integration in ManageIQ

At ManageIQ we have been working on leveraging OpenSCAP to show container images that infringe known vulnerabilities based on the latest CVE content distributed by Red Hat. Integrating with ManageIQ’s “Control” subsystem allows defining workflows & compliance based on SCAP results. The integration was first introduced in the Darga release of ManageIQ and improved for the coming Euwe release.

ManageIQ has a mechanism for introspecting its objects – VMS, Hosts, Container Images, and much more. When running Smart State Analysis on container images, scanning containers are created on the target provider. The container Image being inspected is pulled, mounted, and analyzed for Vulnerabilities. Cluster Load is taken into account.

We will show two flavors of this integration:

  • Run one scan and view result
  • Full blown integration with ManageIQ ‘Control’ subsystem for a container provider

This tutorial requires a running ManageIQ instance that has a container provider. If you do don’t have such an environment but you would like to install one take a look at this link. An offering of a free test OpenShift cluster is also available at Openshift. For both, make sure your ManageIQ appliance has the ‘smartproxy’ and ‘smartstate’ roles enabled:

  1. Navigate to “Configuration -> Server:EVM”.
  2. Make sure “SmartState Analysis” and “smartproxy” roles are enabled.

Run One Scan and View Results:

  1. Navigate to “Compute” -> “Containers” -> “Container Images”.
  2. Select images to scan & press “Configuration” -> “Perform SmartState Analysis”.

That’s it! You can now follow the scan status under “Tasks” -> “All VM And Container Analysis Tasks”. Upon completion you can view the results under the Container Image screen:

Image title

OpenSCAP results for an image, we also provide the standard OpenSCAP HTML as well as a failure summary.


Full Blown Integration With ManageIQ 'Control' Subsystem for a Container Provider

  1. In ManageIQ go to Compute -> Containers -> Providers.
  2. Select providers -> Policy -> “Manage Policies”.
  3. Select the out of the box “OpenSCAP profile” & press apply changes.
  4. Go To “Configuration” -> “Schedules” -> “Add a new Schedule” and add a daily scan of all containers from a certain provider.

Image title

The default OpenSCAP profile.


That’s it! From this point on:

  • New Images discovered will automatically be scanned.
  • All provider Images will be scanned daily (with cluster load considerations in mind).
  • Images with high severity failures will be marked as non-compliant.
  • If a non-compliant image came from OpenShift, we will attempt to label it as non-secure and prevent its execution. This step requires additional configuration in OpenShift.

Using ManageIQ’s ‘Control’ system the sky is the limit: It is possible to define additional policies that would be executed once a compliance check failed or succeeded. It is possible to copy the ‘OpenSCAP Profile’ and create new profiles based on that. For example, a user can choose to define all images with ANY severity failure as non-compliant creating a very hardened system.

Reference

  • OpenScap Acronyms
  • https://www.open-scap.org/resources/acronyms/

    Docker (software) Kubernetes security

    Published at DZone with permission of Mooli Tayer, DZone MVB. See the original article here.

    Opinions expressed by DZone contributors are their own.

    Popular on DZone

    • Create a CLI Chatbot With the ChatGPT API and Node.js
    • How To Set Up and Run Cypress Test Cases in CI/CD TeamCity
    • How To Select Multiple Checkboxes in Selenium WebDriver Using Java
    • File Uploads for the Web (2): Upload Files With JavaScript

    Comments

    Partner Resources

    X

    ABOUT US

    • About DZone
    • Send feedback
    • Careers
    • Sitemap

    ADVERTISE

    • Advertise with DZone

    CONTRIBUTE ON DZONE

    • Article Submission Guidelines
    • Become a Contributor
    • Visit the Writers' Zone

    LEGAL

    • Terms of Service
    • Privacy Policy

    CONTACT US

    • 600 Park Offices Drive
    • Suite 300
    • Durham, NC 27709
    • support@dzone.com
    • +1 (919) 678-0300

    Let's be friends: