Skip to content

GitLab Next

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Menu
    Projects Groups Snippets
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 42,938
    • Issues 42,938
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,351
    • Merge requests 1,351
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 is launching on May 22! This version brings many exciting improvements, but also removes deprecated features and introduces breaking changes that may impact your workflow. To see what is being deprecated and removed, please visit Breaking changes in 15.0 and Deprecations.

  • GitLab.org
  • GitLabGitLab
  • Issues
  • #348628
Closed
Open
Created Dec 12, 2021 by Michael Friedrich@dnsmichi🔴Developer

Trivy/Grype updates to detect log4j vulnerabilities

Problem to solve

Container scanning should detect the log4j CVE-2021-44228.

Grype VP of Security shared a vulnerable container image. https://twitter.com/joshbressers/status/1469411411948417035?s=21

include:
    - template: Security/Container-Scanning.gitlab-ci.yml

container_scanning:
    variables:
        DOCKER_IMAGE: docker.io/dnurmi/testrepo:jarjar   

Trivy

$ trivy docker.io/dnurmi/testrepo:jarjar

$ trivy --version
Version: 0.21.2
Vulnerability DB:
  Type: Full
  Version: 1
  UpdatedAt: 2021-12-12 12:44:43.771732013 +0000 UTC
  NextUpdate: 2021-12-12 18:44:43.771731813 +0000 UTC
  DownloadedAt: 2021-12-12 13:53:11.907624 +0000 UTC 

image

https://github.com/aquasecurity/trivy/issues/1453 mentions the light method being not consistent with the scan detecting the vulnerabilities. The light mode problem needs a trivy fix in https://github.com/aquasecurity/trivy/pull/1458

gcs doesn't use the light mode though.

Grype

A manual run with the vulnerable image works.

$ grype docker.io/dnurmi/testrepo:jarjar

$ grype version
Application:          grype
Version:              0.27.0
Syft Version:         v0.32.0
BuildDate:            2021-12-08T22:17:50Z
GitCommit:            e62186725b8bfe3faddb78fa82b1ca44c747c9b6
GitTreeState:         clean
Platform:             darwin/amd64
GoVersion:            go1.16.10
Compiler:             gc
Supported DB Schema:  3

image

gitlab-org/security-products/analyzers/container-scanning!2622 (merged) updating grype should fix the problem.

Proposal

  • Update Grype and verify it working
  • Analyse why Trivy does not work in gcs

@mparuszewski @thiagocsf I've started analysing the scanners in gitlab-de/playground/log4j-container-scanning!1 but I don't know why they don't work inside gcs. Please help investigate :)

cc @heather @greg @laurence.bierner @JohnathanHunt

Edited Dec 12, 2021 by Michael Friedrich
Assignee
Assign to
Time tracking