Giter VIP home page Giter VIP logo

project-copacetic / copacetic Goto Github PK

View Code? Open in Web Editor NEW
850.0 8.0 59.0 11.48 MB

๐Ÿงต CLI tool for directly patching container images using reports from vulnerability scanners

Home Page: https://project-copacetic.github.io/copacetic/

License: Apache License 2.0

Makefile 3.22% Go 92.93% JavaScript 2.10% CSS 1.63% Open Policy Agent 0.12%
compliance devsecops docker security trivy vulnerability containers container-image container-security patching

copacetic's Introduction

Project Copacetic: Directly patch container image vulnerabilities

GitHub codecov OpenSSF Scorecard FOSSA Status

Copa logo



copa is a CLI tool written in Go and based on buildkit that can be used to directly patch container images given the vulnerability scanning results from popular tools like Trivy.

For more details and how to get started, please refer to full documentation.

Demo

intro

Why?

We needed the ability to patch containers quickly without going upstream for a full rebuild. As the window between vulnerability disclosure and active exploitation continues to narrow, there is a growing operational need to patch critical security vulnerabilities in container images so they can be quickly redeployed into production. The need is especially acute when those vulnerabilities are:

  • inherited from base images several levels deep and waiting on updated releases to percolate through the supply chain is not an option
  • found in 3rd party app images you don't maintain with update cadences that don't meet your security SLAs.

direct image patching

In addition to filling the operational gap not met by left-shift security practices and tools, the ability of copa to patch a container without requiring a rebuild of the container image provides other benefits:

  • Allows users other than the image publishers to also patch container images, such as DevSecOps engineers.
  • Reduces the storage and transmission costs of redistributing patched images by only creating an additional patch layer, instead of rebuilding the entire image which usually results in different layer hashes that break layer caching.
  • Reduces the turnaround time for patching a container image by not having to wait for base image updates and being a faster operation than a full image rebuild.
  • Reduces the complexity of patching the image from running a rebuild pipeline to running a single tool on the image.

How?

The copa tool is an extensible engine that:

  1. Parses the needed update packages from the container imageโ€™s vulnerability report produced by a scanner like Trivy. New adapters can be written to accommodate more report formats.
  2. Obtains and processes the needed update packages using the appropriate package manager tools such as apt, apk, etc. New adapters can be written to support more package managers.
  3. Applies the resulting update binaries to the container image using buildkit.

report-driven vulnerability patching

This approach is motivated by the core principles of making direct container patching broadly applicable and accessible:

  • Copa supports patching existing container images.
    • Devs don't need to build their images using specific tools or modify them in some way just to support container patching.
  • Copa works with the existing vulnerability scanning and mitigation ecosystems.
    • Image publishers don't need to create new workflows for container patching since Copa supports patching container images using the security update packages already being published today.
    • Consumers do not need to migrate to a new and potentially more limited support ecosystem for custom distros or change their container vulnerability scanning pipelines to include remediation, since Copa can be integrated seamlessly as an extra step to patch containers based on those scanning reports.
  • Copa reduces the technical expertise needed and waiting on dependencies needed to patch an image.
    • For OS package vulnerabilities, no specialized knowledge about a specific image is needed to be patch it as Copa relies on the vulnerability remediation knowledge already embedded in the reports produced by popular container scanning tools today.

Contributing

There are several ways to get involved:

The project welcomes contributions and suggestions that abide by the CNCF Code of Conduct.

copacetic's People

Contributors

anubhav06 avatar ashnamehrotra avatar christoffernissen avatar codemonkeyleet avatar cpuguy83 avatar dependabot[bot] avatar derdanne avatar github-actions[bot] avatar johnsonshi avatar lachie83 avatar miahacybersec avatar pmengelbert avatar prakrit55 avatar realharshthakur avatar salaxander avatar smurawski avatar sozercan avatar ssbostan avatar step-security-bot avatar testwill avatar tomdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

copacetic's Issues

[REQ] add a report for patched vulns

What kind of request is this?

New feature

What is your request or suggestion?

Output a report that includes which components got patched for what CVEs

[REQ] flag to continue when there are errors

What kind of request is this?

New feature

What is your request or suggestion?

today, we fail patching if any package fails to patch

if patching fails for a package for whatever reason, we might want to continue anyway to produce an image

[REQ] Ability to patch with awareness of licensing conditions

What kind of request is this?

New feature

What is your request or suggestion?

Direct feedback after demoing copa:

One other feature I would like to see from Copacetic would be the ability to specify the licenses I'm willing to incorporate into my images. Sometimes, ensuring licensing models are in tact may be more important to the business than the security patching at the image level. Said another way, sometimes I'll block that at the perimeter rather than open myself up to possible licensing litigation. It would be nice to patch unless the patch requires me to violate an acceptable license rule I have in place.

[BUG] fix image publishing for copa-action

Version of copa

No response

Expected Behavior

No response

Actual Behavior

release process fails with the following error:

#10 ERROR: failed to push ghcr.io/project-copacetic/copa-action:v0.4.0: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://ghcr.io/token?scope=repository%3Aproject-copacetic%2Fcopa-action%3Apull%2Cpush&service=ghcr.io: 403 Forbidden

Looks like action needs permission to push to GHCR

Steps To Reproduce

https://github.com/project-copacetic/copacetic/actions/runs/5942389504/job/16115269547

[REQ] support for app-level patching

What is your question?

Hey there ๐Ÿ‘‹ .. First of all thanks for this great project! .. Just was curious, if there's a plan to also (maybe conditionally) support patching application specific dependencies and not only OS-level dependencies.

Some background / example context: A Spring Boot App that's running on eclipse-temurin:17-jre-alpine might have the list of vulnerabilties below:

myregistry.com/some-app:latest (alpine 3.17.3)

Total: 2 (UNKNOWN: 0, LOW: 0, MEDIUM: 2, HIGH: 0, CRITICAL: 0)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Library   โ”‚ Vulnerability โ”‚ Severity โ”‚ Installed Version โ”‚ Fixed Version โ”‚                           Title                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ libcrypto3 โ”‚ CVE-2023-1255 โ”‚ MEDIUM   โ”‚ 3.0.8-r3          โ”‚ 3.0.8-r4      โ”‚ Input buffer over-read in AES-XTS implementation on 64 bit โ”‚
โ”‚            โ”‚               โ”‚          โ”‚                   โ”‚               โ”‚ ARM                                                        โ”‚
โ”‚            โ”‚               โ”‚          โ”‚                   โ”‚               โ”‚ https://avd.aquasec.com/nvd/cve-2023-1255                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค               โ”‚          โ”‚                   โ”‚               โ”‚                                                            โ”‚
โ”‚ libssl3    โ”‚               โ”‚          โ”‚                   โ”‚               โ”‚                                                            โ”‚
โ”‚            โ”‚               โ”‚          โ”‚                   โ”‚               โ”‚                                                            โ”‚
โ”‚            โ”‚               โ”‚          โ”‚                   โ”‚               โ”‚                                                            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
2023-05-12T17:08:53.318+0200    INFO    Table result includes only package filenames. Use '--format json' option to get the full path to the package file.

Java (jar)

Total: 8 (UNKNOWN: 0, LOW: 0, MEDIUM: 5, HIGH: 1, CRITICAL: 2)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Library                      โ”‚  Vulnerability   โ”‚ Severity โ”‚ Installed Version โ”‚ Fixed Version โ”‚                            Title                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ org.springframework:spring-web (application.jar) โ”‚ CVE-2016-1000027 โ”‚ CRITICAL โ”‚ 5.3.27            โ”‚ 6.0.0         โ”‚ spring: HttpInvokerServiceExporter readRemoteInvocation      โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ method untrusted java deserialization                        โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ https://avd.aquasec.com/nvd/cve-2016-1000027                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค          โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ org.yaml:snakeyaml (application.jar)             โ”‚ CVE-2022-1471    โ”‚          โ”‚ 1.30              โ”‚ 2.0           โ”‚ Constructor Deserialization Remote Code Execution            โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ https://avd.aquasec.com/nvd/cve-2022-1471                    โ”‚
โ”‚                                                  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค                   โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                  โ”‚ CVE-2022-25857   โ”‚ HIGH     โ”‚                   โ”‚ 1.31          โ”‚ Denial of Service due to missing nested depth limitation for โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ collections                                                  โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ https://avd.aquasec.com/nvd/cve-2022-25857                   โ”‚
โ”‚                                                  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค                   โ”‚               โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                  โ”‚ CVE-2022-38749   โ”‚ MEDIUM   โ”‚                   โ”‚               โ”‚ Uncaught exception in                                        โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ org.yaml.snakeyaml.composer.Composer.composeSequenceNode     โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ https://avd.aquasec.com/nvd/cve-2022-38749                   โ”‚
โ”‚                                                  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค          โ”‚                   โ”‚               โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                  โ”‚ CVE-2022-38750   โ”‚          โ”‚                   โ”‚               โ”‚ Uncaught exception in                                        โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ org.yaml.snakeyaml.constructor.BaseConstructor.constructObj- โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ ect                                                          โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ https://avd.aquasec.com/nvd/cve-2022-38750                   โ”‚
โ”‚                                                  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค          โ”‚                   โ”‚               โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                  โ”‚ CVE-2022-38751   โ”‚          โ”‚                   โ”‚               โ”‚ Uncaught exception in                                        โ”‚
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ java.base/java.util.regex.Pattern$Ques.match                 โ”‚       
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ https://avd.aquasec.com/nvd/cve-2022-38751                   โ”‚       
โ”‚                                                  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค          โ”‚                   โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค       
โ”‚                                                  โ”‚ CVE-2022-38752   โ”‚          โ”‚                   โ”‚ 1.32          โ”‚ Uncaught exception in java.base/java.util.ArrayList.hashCode โ”‚       
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ https://avd.aquasec.com/nvd/cve-2022-38752                   โ”‚       
โ”‚                                                  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค          โ”‚                   โ”‚               โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค       
โ”‚                                                  โ”‚ CVE-2022-41854   โ”‚          โ”‚                   โ”‚               โ”‚ DoS via stack overflow                                       โ”‚       
โ”‚                                                  โ”‚                  โ”‚          โ”‚                   โ”‚               โ”‚ https://avd.aquasec.com/nvd/cve-2022-41854                   โ”‚       
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  

With Copa, I am so glad that I can get libcrypto3 & libssl3 patched and hence get no base image vulnerabilties anymore. However, what about the lovely snakeyaml in my application? ๐Ÿ˜„ .. Despite using the latest (or maybe I could say fairly new) version of the Spring Boot framework, the upstream project didn't update the vulnerable library .. soooo

[REQ] mirror or pin the images used in test images

What kind of request is this?

Other

What is your request or suggestion?

we should mirror the images used in the tests to a registry (like ghcr) or as tarballs or pin to digests so they don't change

[REQ] Add copa to homebrew

What kind of request is this?

Improvement of existing experience

What is your request or suggestion?

We should consider adding copa to brew to provide a more seamless installation experience for Mac and Linux users

[REQ] modular scanners

What kind of request is this?

New feature

What is your request or suggestion?

It would be good to have scanners to be modular so they don't have to live in the core copacetic repository. The intention is for others to contribute without each scanner being part of the core copa.

perhaps a model like https://github.com/deislabs/ratify/blob/main/pkg/verifier/plugin/skel/skel.go https://github.com/deislabs/ratify/blob/main/plugins/verifier/licensechecker/licensechecker.go (example) which defines inputs and outputs might work

[REQ] copa --version

What kind of request is this?

None

What is your request or suggestion?

No response

[REQ] support for kubescape json as input

What kind of request is this?

New feature

What is your request or suggestion?

copa currently supports patching images using report generated by Trivy in JSON format
FEATURE:
add support to copa for patching images using report format generated by Kubescape as well, in JSON format.

[DOC] filtering vulns with trivy

What kind of documentation improvement is needed?

None

What is the change that is needed?

document how to filter vulns using rego policy or ignore file
https://aquasecurity.github.io/trivy/v0.43/docs/configuration/filtering/

example from CI:

package trivy
import data.lib.trivy
default ignore = false
ignore_vulnerability_ids := {
# centos 7.6.1810
# bind-license package version "9.11.4-26.P2.el7_9.14" does not exist
"CVE-2023-2828"
}
ignore {
input.VulnerabilityID == ignore_vulnerability_ids[_]
}

[BUG] remaining libssl vulnerability after patching

Version of copa

v0.1.0

Expected Behavior

No remaining vulnerabilities after patching

Actual Behavior

Original image contains libssl and openssl vulnerabilities (at the time of this writing).

Copa patch reports both are fixed and validated.

INFO[0001] Validated package libssl1.1 version 1.1.1n-0+deb11u4 meets requested version 1.1.1n-0+deb11u4
INFO[0001] Validated package openssl version 1.1.1n-0+deb11u4 meets requested version 1.1.1n-0+deb11u4

After patching, openssl vulnerability is resolved. However libssl still reports vulnerabilities.

Steps To Reproduce

trivy image --vuln-type os --ignore-unfixed --scanners vuln openpolicyagent/opa:0.46.0 --format json -o opa.json
Total: 10 (UNKNOWN: 0, LOW: 0, MEDIUM: 8, HIGH: 2, CRITICAL: 0)

copa patch \  
    -i openpolicyagent/opa:0.46.0 \
    -r opa.json \
    -t 0.46.0-patched \
    -a tcp://0.0.0.0:$BUILDKIT_PORT --timeout 60m

trivy image --vuln-type os --ignore-unfixed --scanners vuln openpolicyagent/opa:0.46.0-patched
Total: 5 (UNKNOWN: 0, LOW: 0, MEDIUM: 4, HIGH: 1, CRITICAL: 0)

[REQ] Handle secure registries

What kind of request is this?

New feature

What is your request or suggestion?

Handle secure registries in copa:

  • if image exists locally already, skip pulling the image
  • if pulling image, handle authentication: copa will need to know how to use the auth file locally to authenticate with the registry)

[REQ] Support pushing to registry directly

What kind of request is this?

Improvement of existing experience

What is your request or suggestion?

It would be nice to push to the image registry directly.
Like :

copa patch -i docker.io/library/alpine:3.16.4 -r patch.json -p ttl.sh/alpinepatched:1h

One side-effect of this would be that copa wouldn't rely on Docker anymore if there is a remote buildkit setup as I mentioned here. #285 (comment)

[REQ] Support for Copa to connect to remote buildkit

Really cool project :)

What kind of request is this?

Improvement of existing experience

What is your request or suggestion?

Hey folks, I'd like to use Copa using a remote buildkit daemon, if people have builds and patching done over the same buildkit instance, they'll benefit from the cache.

I've submitted a PR to support it: #284

[DOC] make it clear that copa only patches OS vulnerabilities today

What kind of documentation improvement is needed?

Missing information or guidance

What is the change that is needed?

We should be clear on the copa capabilities today. I had a few questions from folks that thought it would patch Go or Java app level dependency vulnerabilities

We should also clarify what is an "OS" vs "App" vulnerability

[BUG] ERROR exporting to docker image format

Version of copa

v0.2.0

Expected Behavior

Patched image is exported successfully

Actual Behavior

Encountered below error and then output froze, I had to ^C to exit.

 => ERROR exporting to docker image format                                                                                                              0.7s
 => => exporting layers                                                                                                                                 0.7s
 => => exporting manifest sha256:f4bxxxx2f7                                                       0.0s
 => => exporting config sha256:fadxxxx26f                                                         0.0s
------
 > exporting to docker image format:
------

Steps To Reproduce

  1. Installed with brew install copa

  2. Ran buildkit in a container with docker run --detach --rm --privileged -p 127.0.0.1:8888:8888/tcp --name buildkitd --entrypoint buildkitd moby/buildkit --addr tcp://0.0.0.0:8888

  3. Ran trivy image --vuln-type os --ignore-unfixed -f json -o my-image.json my-image:test

  4. Ran copa patch -i my-image:test -r my-image.json -t -patched -a tcp://0.0.0.0:8888

  5. Received the error as shared above

Details about image from docker inspect, Architecture: arm64, Os: linux

[REQ] GitHub Action for copa

What kind of request is this?

New feature

What is your request or suggestion?

We should design a GitHub action to utilize copa. I think that would live in a separate repo in the same org

[BUG] failed to verify certificate when patch image

Version of copa

v0.2.0-17-g4d03dd1

Expected Behavior

fix the os vuln in image successfully

Actual Behavior

failed to patch image because copa can't request registry

Steps To Reproduce

  1. On Ubuntu 22.04 x86_64 environment.And docker version is 23.0.6
$ lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04 LTS
Release:	22.04
Codename:	jammy
$ docker version

Client: Docker Engine - Community
 Version:           23.0.6
 API version:       1.42
 Go version:        go1.19.9
 Git commit:        ef23cbc
 Built:             Fri May  5 21:18:13 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          23.0.6
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.19.9
  Git commit:       9dbdbd4
  Built:            Fri May  5 21:18:13 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
  1. I have set the insecure registry like this,So I can pull image from registry successfully
$ cat /etc/docker/daemon.json

{
   "insecure-registries":["https://192.168.1.94","192.168.1.94:443"]
}
  1. Run copa patch -i 192.168.1.94:443/deploy/my_image:v1.1 -r my_image_v1.1.json -t v1.1-patched --debug to patch image
  2. See error:failed to verify certificate
DEBU[0000] updates to apply: &{alpine 3.17.0 amd64 [{libcom_err 1.46.6-r0} {libcrypto3 3.0.7-r2} {libcrypto3 3.0.8-r0} {libcrypto3 3.0.8-r0} {libcrypto3 3.0.8-r0} {libcrypto3 3.0.8-r0} {libcrypto3 3.0.8-r0} {libcrypto3 3.0.8-r0} {libcrypto3 3.0.8-r1} {libcrypto3 3.0.8-r0} {libcrypto3 3.0.8-r0} {libcrypto3 3.0.8-r2} {libcrypto3 3.0.8-r3} {libcrypto3 3.0.8-r4} {libssl3 3.0.7-r2} {libssl3 3.0.8-r0} {libssl3 3.0.8-r0} {libssl3 3.0.8-r0} {libssl3 3.0.8-r0} {libssl3 3.0.8-r0} {libssl3 3.0.8-r0} {libssl3 3.0.8-r1} {libssl3 3.0.8-r0} {libssl3 3.0.8-r0} {libssl3 3.0.8-r2} {libssl3 3.0.8-r3} {libssl3 3.0.8-r4}]}
DEBU[0000] resolving                                     host="192.168.1.94:443"
DEBU[0000] do request                                    host="192.168.1.94:443" request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=buildkit/0.0.0+unknown request.method=HEAD url="https://192.168.1.94:443/v2/deploy/my_image/manifests/v1.1"
INFO[0000] trying next host                              error="failed to do request: Head \"https://192.168.1.94:443/v2/deploy/my_image/manifests/v1.1\": tls: failed to verify certificate: x509: certificate signed by unknown authority" host="192.168.1.94:443"
WARN[0000] --debug specified, working folder at /tmp/copa-3163234201 needs to be manually cleaned up
Error: failed to do request: Head "https://192.168.1.94:443/v2/deploy/my_image/manifests/v1.1": tls: failed to verify certificate: x509: certificate signed by unknown authority

[BUG] Unable to patch image when failed to communicate with buildkitd

Version of copa

v0.2.0

Expected Behavior

Patch succeeds

Actual Behavior

Starting image patching
Error: failed to dial gRPC: rpc error: code = Unavailable desc = rpc error: code = Unavailable desc = connection error: desc = "transport: error while dialing: dial unix /run/buildkit/buildkitd.sock: connect: no such file or directory"
Finished image patching
time="2023-05-21T22:35:21Z" level=info msg="auto snapshotter: using overlayfs"
time="2023-05-21T22:35:21Z" level=warning msg="using host network as the default"
time="2023-05-21T22:35:21Z" level=info msg="found worker \"q5k6257l21nsa2apkvri5g60b\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:vm1 org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/amd64/v4 linux/386]"
time="2023-05-21T22:35:21Z" level=warning msg="using host network as the default"
time="2023-05-21T22:35:21Z" level=info msg="found worker \"w4v4jlc5lrw5c8i6r42f4j909\", labels=map[org.mobyproject.buildkit.worker.containerd.namespace:buildkit org.mobyproject.buildkit.worker.containerd.uuid:91fde356-0f86-4d04-9899-109cbdb56f59 org.mobyproject.buildkit.worker.executor:containerd org.mobyproject.buildkit.worker.hostname:vm1 org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/amd64/v4 linux/386]"
time="2023-05-21T22:35:21Z" level=info msg="found 2 workers, default=\"q5k6257l21nsa2apkvri5g60b\""
time="2023-05-21T22:35:21Z" level=warning msg="currently, only the default worker can be used."
time="2023-05-21T22:35:21Z" level=info msg="stopping server"
buildkitd: context canceled

Steps To Reproduce

Followed the steps from https://project-copacetic.github.io/copacetic/website/quick-start#sample-steps
This seems to be a sporadic occurrence when there's an issue with buildkit.
Ideally copa should be fault tolerant.

[REQ] copa as a buildkit frontend

What kind of request is this?

None

What is your request or suggestion?

use copa as a buildkit frontend to generate build context and pass to buildkit

example: copa generate -i foo/bar -t patched | docker build -

[REQ] Add http proxy support when executing package managers

What kind of request is this?

Improvement of existing experience

What is your request or suggestion?

I would like to add http proxy support when executing package manager updates, so we can use this tool in environments using corporate proxies.

[REQ] Add Oracle Linux as supported OS

What kind of request is this?

New feature

What is your request or suggestion?

Currently, Oracle Linux (https://hub.docker.com/_/oraclelinux) cannot be patched and the following error message is shown:

Error: unsupported osType oracle specified

Please, add support for Oracle Linux.

Note: Oracle Linux 7 uses yum, while starting with version 8 dnf is used as package manager.

[REQ] Dependabot plugin

What kind of request is this?

New feature

What is your request or suggestion?

We could write a dependabot plugin that patches similar to how depedabot handles dependencies today

[REQ] Patch local images

What kind of request is this?

Improvement of existing experience

What is your request or suggestion?

Is it possible \ desirable to allow Copa to patch local images instead of requiring a remote registry? At the moment when Copa is used as part of a build pipeline you have to push your image to a remote registry, patch it, then push the image to the registry again. With the ability to patch local images you could build, patch, and then only push the image once.

[DOC] document copa action

What kind of documentation improvement is needed?

Other

What is the change that is needed?

document copa action in copa docs

[REQ] improve unit test coverage

What kind of request is this?

Other

What is your request or suggestion?

Missing coverage in most of the packages

?       github.com/project-copacetic/copacetic/pkg/buildkit     [no test files]
?       github.com/project-copacetic/copacetic/pkg/patch        [no test files]
?       github.com/project-copacetic/copacetic/pkg/pkgmgr       [no test files]
?       github.com/project-copacetic/copacetic/pkg/report       [no test files]
?       github.com/project-copacetic/copacetic/pkg/types        [no test files]
ok      github.com/project-copacetic/copacetic/pkg/utils        0.003s

[BUG] Downloads not the latest version or fixedVersion of the packages

Version of copa

v0.2.0

Expected Behavior

I've expected that the patch applies the latest or at least the highest fixedVersion number of a package in case there are a few of the same libraries listed in the patch.json.

Which would update in my case for example:

  • libwebp from version 1.2.3-r0 to 1.3.0-r3"
  • tiff from version 4.4.0-r0 to 4.5.0-r0

Actual Behavior

Instead copa seems to update the package to the next version in row.

Error: 5 errors occurred:
        ...
        * downloaded package libwebp version 1.2.3-r1 lower than required 1.3.0-r3 for update
        * downloaded package tiff version 4.4.0-r3 lower than required 4.5.0-r0 for update

Steps To Reproduce

  1. Run trivy
root@6f623b4cd7d7:/azp# trivy image --exit-code 0 --format json --output ./patch.json --scanners vuln --vuln-type os --ignore-unfixed --severity "HIGH" some-registry.org/repo/corp-aspnetcore:6.0-alpine
2023-06-21T10:20:54.536Z        INFO    Vulnerability scanning is enabled
2023-06-21T10:20:54.545Z        INFO    Detected OS: alpine
2023-06-21T10:20:54.545Z        INFO    Detecting Alpine vulnerabilities...
  1. Display trivy output
root@6f623b4cd7d7:/azp# cat patch.json | jq '.Results[0].Vulnerabilities[] | "\(.PkgID) \(.Severity) \(.CweIDs) \(.Title) \(.InstalledVersion) \(.FixedVersion)"' | sort | uniq
"[email protected] HIGH [\"CWE-190\"] integer overflow vulnerabilities in PAC parsing 1.19.4-r0 1.20.1-r0"
"[email protected] HIGH [\"CWE-120\"] X.509 Email Address Buffer Overflow 1.1.1t-r0 3.0.7-r0"
"[email protected] HIGH [\"CWE-120\"] X.509 Email Address Variable Length Buffer Overflow 1.1.1t-r0 3.0.7-r0"
"[email protected] HIGH [\"CWE-295\"] Denial of service by excessive resource usage in verifying X509 policy constraints 1.1.1t-r0 3.1.0-r1"
"[email protected] HIGH [\"CWE-404\"] OPENSSL_LH_flush() breaks reuse of memory 1.1.1t-r0 3.0.3-r0"
"[email protected] HIGH [\"CWE-415\"] double free after calling PEM_read_bio_ex 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-416\"] use-after-free following BIO_new_NDEF 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-476\"] invalid pointer dereference in d2i_PKCS7 functions 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-476\"] NULL dereference during PKCS7 data verification 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-476\"] NULL dereference validating DSA public key 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-476\"] Using a Custom Cipher with NID_undef may lead to NULL encryption 1.1.1t-r0 3.0.6-r0"
"[email protected] HIGH [\"CWE-667\"] openssl: double locking leads to denial of service 1.1.1t-r0 3.0.7-r2"
"[email protected] HIGH [\"CWE-770\"] Possible DoS translating ASN.1 object identifiers 1.1.1t-r0 3.1.1-r0"
"[email protected] HIGH [\"CWE-835\"] openssl: Infinite loop in BN_mod_sqrt() reachable when parsing certificates 1.1.1t-r0 3.0.2-r0"
"[email protected] HIGH [\"CWE-835\"] openssl: invalid handling of X509_verify_cert() internal errors in libssl 1.1.1t-r0 3.0.1-r0"
"[email protected] HIGH [\"CWE-843\"] X.400 address type confusion in X.509 GeneralName 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-120\"] X.509 Email Address Buffer Overflow 1.1.1t-r0 3.0.7-r0"
"[email protected] HIGH [\"CWE-120\"] X.509 Email Address Variable Length Buffer Overflow 1.1.1t-r0 3.0.7-r0"
"[email protected] HIGH [\"CWE-295\"] Denial of service by excessive resource usage in verifying X509 policy constraints 1.1.1t-r0 3.1.0-r1"
"[email protected] HIGH [\"CWE-404\"] OPENSSL_LH_flush() breaks reuse of memory 1.1.1t-r0 3.0.3-r0"
"[email protected] HIGH [\"CWE-415\"] double free after calling PEM_read_bio_ex 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-416\"] use-after-free following BIO_new_NDEF 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-476\"] invalid pointer dereference in d2i_PKCS7 functions 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-476\"] NULL dereference during PKCS7 data verification 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-476\"] NULL dereference validating DSA public key 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH [\"CWE-476\"] Using a Custom Cipher with NID_undef may lead to NULL encryption 1.1.1t-r0 3.0.6-r0"
"[email protected] HIGH [\"CWE-667\"] openssl: double locking leads to denial of service 1.1.1t-r0 3.0.7-r2"
"[email protected] HIGH [\"CWE-770\"] Possible DoS translating ASN.1 object identifiers 1.1.1t-r0 3.1.1-r0"
"[email protected] HIGH [\"CWE-835\"] openssl: Infinite loop in BN_mod_sqrt() reachable when parsing certificates 1.1.1t-r0 3.0.2-r0"
"[email protected] HIGH [\"CWE-835\"] openssl: invalid handling of X509_verify_cert() internal errors in libssl 1.1.1t-r0 3.0.1-r0"
"[email protected] HIGH [\"CWE-843\"] X.400 address type confusion in X.509 GeneralName 1.1.1t-r0 3.0.8-r0"
"[email protected] HIGH null Double-free in libwebp 1.2.3-r0 1.3.0-r3"
"[email protected] HIGH [\"CWE-189\",\"CWE-190\"] integer overflow in function TIFFReadRGBATileExt of the file 4.4.0-r0 4.5.0-r0"
  1. Apply patch with copa
root@6f623b4cd7d7:/azp# copa patch -i some-registry.org/repo/corp-aspnetcore:6.0-alpine -r ./patch.json -t 6.0-alpine-patched
[+] Building 0.1s (8/8) FINISHED
 => docker-image://some-registry.org/repo/corp-aspnetcore:6.0-alpine                                                                                                                                                                                                                                            0.0s
 => => resolve some-registry.org/repo/corp-aspnetcore:6.0-alpine                                                                                                                                                                                                                                                0.0s
 => CACHED apk update                                                                                                                                                                                                                                                                                                   0.0s
 => CACHED apk add --no-cache krb5-libs libcrypto1.1 libssl1.1 libwebp tiff                                                                                                                                                                                                                                             0.0s
 => CACHED apk upgrade --no-cache krb5-libs libcrypto1.1 libssl1.1 libwebp tiff                                                                                                                                                                                                                                         0.0s
 => CACHED mkdir /copa-out                                                                                                                                                                                                                                                                                              0.0s
 => CACHED sh -c apk info --installed -v krb5-libs libcrypto1.1 libssl1.1 libwebp tiff > results.manifest; if [[ $? -ne 0 ]]; then echo "WARN: apk info --installed returned $?"; fi                                                                                                                                    0.0s
 => CACHED diff (apk upgrade --no-cache krb5-libs libcrypto1.1 libssl1.1 libwebp tiff) -> (sh -c apk info --installed -v krb5-libs libcrypto1.1 libssl1.1 libwebp tiff > results.manifest; if [[ $? -ne 0 ]]; then echo "WARN: apk info --installed returned $?"; fi)                                                   0.0s
 => exporting to client directory                                                                                                                                                                                                                                                                                       0.0s
 => => copying files 172B                                                                                                                                                                                                                                                                                               0.0s
ERRO[0000] downloaded package krb5-libs version 1.19.4-r0 lower than required 1.20.1-r0 for update
ERRO[0000] downloaded package libcrypto1.1 version 1.1.1u-r1 lower than required 3.1.1-r0 for update
ERRO[0000] downloaded package libssl1.1 version 1.1.1u-r1 lower than required 3.1.1-r0 for update
ERRO[0000] downloaded package libwebp version 1.2.3-r1 lower than required 1.3.0-r3 for update
ERRO[0000] downloaded package tiff version 4.4.0-r3 lower than required 4.5.0-r0 for update
Error: 5 errors occurred:
        * downloaded package krb5-libs version 1.19.4-r0 lower than required 1.20.1-r0 for update
        * downloaded package libcrypto1.1 version 1.1.1u-r1 lower than required 3.1.1-r0 for update
        * downloaded package libssl1.1 version 1.1.1u-r1 lower than required 3.1.1-r0 for update
        * downloaded package libwebp version 1.2.3-r1 lower than required 1.3.0-r3 for update
        * downloaded package tiff version 4.4.0-r3 lower than required 4.5.0-r0 for update

This does not happen with all our images. Is there anything I'm missing?

Thanks for taking the time to take care of this.

[REQ] Skip request to container registry when image already exists locally

What kind of request is this?

Improvement of existing experience

What is your request or suggestion?

I would like copa to be able to scan an image built within a pipeline that is tagged with a remote hostname, but exists locally.

In our setup we build an image and tag registry-name.azurecr.io/repo:tag. At this point in time (build only / PR validation) the pipeline isn't authenticated to the container registry. Trivy scans this after build using the local image. We've then setup to run copa on this image but currently it fails with the debug log:

time="2023-06-09T06:17:02Z" level=debug msg=resolving host=registry-name.azurecr.io
time="2023-06-09T06:17:02Z" level=debug msg="do request" host=registry-name.azurecr.io request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=buildkit/0.0.0+unknown request.method=HEAD url="https://registry-name.azurecr.io/v2/repo/manifests/tag"
time="2023-06-09T06:17:02Z" level=debug msg="fetch response received" host=registry-name.azurecr.io response.header.access-control-expose-headers=Docker-Content-Digest response.header.access-control-expose-headers.1=WWW-Authenticate response.header.access-control-expose-headers.2=Link response.header.access-control-expose-headers.3=X-Ms-Correlation-Request-Id response.header.connection=keep-alive response.header.content-length=211 response.header.content-type="application/json; charset=utf-8" response.header.date="Fri, 09 Jun 2023 06:17:02 GMT" response.header.docker-distribution-api-version=registry/2.0 response.header.server=openresty response.header.strict-transport-security="max-age=31536000; includeSubDomains" response.header.strict-transport-security.1="max-age=31536000; includeSubDomains" response.header.www-authenticate="Bearer realm=\"https://registry-name.azurecr.io/oauth2/token\",service=\"registry-name.azurecr.io\",scope=\"repository:repo:pull\"" response.header.x-content-type-options=nosniff response.header.x-ms-correlation-request-id=60b02c26-0626-4ffe-b00e-4a39acb5ccb7 response.status="401 Unauthorized" url="https://registry-name.azurecr.io/v2/repo/manifests/tag"
time="2023-06-09T06:17:02Z" level=debug msg=Unauthorized header="Bearer realm=\"https://registry-name.azurecr.io/oauth2/token\",service=\"registry-name.azurecr.io\",scope=\"repository:repo:pull\"" host=registry-name.azurecr.io
time="2023-06-09T06:17:02Z" level=debug msg="do request" host=registry-name.azurecr.io request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=buildkit/0.0.0+unknown request.method=HEAD url="https://registry-name.azurecr.io/v2/repo/manifests/tag"
time="2023-06-09T06:17:02Z" level=info msg="trying next host" error="failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://registry-name.azurecr.io/oauth2/token?scope=repository%3Arepo%3Apull&service=registry-name.azurecr.io: 401 Unauthorized" host=registry-name.azurecr.io
time="2023-06-09T06:17:02Z" level=warning msg="--debug specified, working folder at /tmp/copa-1306459613 needs to be manually cleaned up"
Error: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://registry-name.azurecr.io/oauth2/token?scope=repository%3Arepo%3Apull&service=registry-name.azurecr.io: 401 Unauthorized
##[debug]Exit code 1 received from tool '/usr/bin/bash'

If the image already exists on the build machine, can this request and hence authentication process be skipped and work with the local image?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.