imagesumdb

command module
v0.0.0-...-abb798d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

ImageSumDB

A simple container image database for vuln scanning and version pinning

ImageSumDB provides a flexible database as a dependency for projects that deploy dockerimages. It is a simple database that stores the name of the image and the sum of the image. The sum is calculated by the sha256sum of the image. The database is stored in a file called db.yaml in the current working directory.

Installation

go install github.com/mheers/imagesumdb/cmd@latest

Features

  • Add images to the database
  • Calculate the sum of the image
  • Check if the image is in the database
  • Vulnerability check of the image

Usage

See godoc for more information.

Example

cfg := config.Config{
    RegistryRewrites: map[string]string{
        "docker.io": "registry-1.docker.io",
    },
    EnableRewrite: true,
    DBFile:        "db.yaml",
    ForceDigest:   true,
}

dbInstance := db.NewDB(&cfg)
err := dbInstance.ReadImagePersistance()
if err != nil {
    panic(err)
}

err = dbInstance.Set("baseimage", image.NewImage(&cfg, "alpine", "3.16"))
if err != nil {
    panic(err)
}

err = dbInstance.CompareSetImagesWithPersistance()
if err != nil {
    panic(err)
}

err = dbInstance.Vulncheck()
if err != nil {
    panic(err)
}

err = dbInstance.Write()
if err != nil {
    panic(err)
}

Alternatives

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL