mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
rename to syft
This commit is contained in:
parent
2132700198
commit
a4016d35ce
192 changed files with 241 additions and 239 deletions
|
@ -85,16 +85,16 @@ jobs:
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- unit-test-java-cache-{{ checksum "imgbom/cataloger/java/test-fixtures/java-builds/packages.fingerprint" }}
|
- unit-test-java-cache-{{ checksum "syft/cataloger/java/test-fixtures/java-builds/packages.fingerprint" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: run unit tests
|
name: run unit tests
|
||||||
command: make unit
|
command: make unit
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: unit-test-java-cache-{{ checksum "imgbom/cataloger/java/test-fixtures/java-builds/packages.fingerprint" }}
|
key: unit-test-java-cache-{{ checksum "syft/cataloger/java/test-fixtures/java-builds/packages.fingerprint" }}
|
||||||
paths:
|
paths:
|
||||||
- "imgbom/cataloger/java/test-fixtures/java-builds/packages"
|
- "syft/cataloger/java/test-fixtures/java-builds/packages"
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: build hash key for integration test-fixtures blobs
|
name: build hash key for integration test-fixtures blobs
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
builds:
|
builds:
|
||||||
- binary: imgbom
|
- binary: syft
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
goos:
|
goos:
|
||||||
|
@ -15,15 +15,15 @@ builds:
|
||||||
-w
|
-w
|
||||||
-s
|
-s
|
||||||
-extldflags '-static'
|
-extldflags '-static'
|
||||||
-X github.com/anchore/imgbom/internal/version.version={{.Version}}
|
-X github.com/anchore/syft/internal/version.version={{.Version}}
|
||||||
-X github.com/anchore/imgbom/internal/version.gitCommit={{.Commit}}
|
-X github.com/anchore/syft/internal/version.gitCommit={{.Commit}}
|
||||||
-X github.com/anchore/imgbom/internal/version.buildDate={{.Date}}
|
-X github.com/anchore/syft/internal/version.buildDate={{.Date}}
|
||||||
-X github.com/anchore/imgbom/internal/version.gitTreeState={{.Env.BUILD_GIT_TREE_STATE}}
|
-X github.com/anchore/syft/internal/version.gitTreeState={{.Env.BUILD_GIT_TREE_STATE}}
|
||||||
|
|
||||||
nfpms:
|
nfpms:
|
||||||
- license: "Apache 2.0"
|
- license: "Apache 2.0"
|
||||||
maintainer: "Anchore, Inc"
|
maintainer: "Anchore, Inc"
|
||||||
homepage: &website "https://github.com/anchore/imgbom"
|
homepage: &website "https://github.com/anchore/syft"
|
||||||
description: &description "A tool that generates a Software Bill Of Materials (SBOM) from container images and filesystems"
|
description: &description "A tool that generates a Software Bill Of Materials (SBOM) from container images and filesystems"
|
||||||
formats:
|
formats:
|
||||||
- rpm
|
- rpm
|
||||||
|
@ -32,7 +32,7 @@ nfpms:
|
||||||
brews:
|
brews:
|
||||||
- tap:
|
- tap:
|
||||||
owner: anchore
|
owner: anchore
|
||||||
name: homebrew-imgbom
|
name: homebrew-syft
|
||||||
homepage: *website
|
homepage: *website
|
||||||
description: *description
|
description: *description
|
||||||
|
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -1,4 +1,4 @@
|
||||||
BIN = imgbom
|
BIN = syft
|
||||||
TEMPDIR = ./.tmp
|
TEMPDIR = ./.tmp
|
||||||
RESULTSDIR = $(TEMPDIR)/results
|
RESULTSDIR = $(TEMPDIR)/results
|
||||||
COVER_REPORT = $(RESULTSDIR)/cover.report
|
COVER_REPORT = $(RESULTSDIR)/cover.report
|
||||||
|
@ -129,7 +129,7 @@ test/integration/test-fixtures/tar-cache.key, integration-fingerprint:
|
||||||
|
|
||||||
.PHONY: java-packages-fingerprint
|
.PHONY: java-packages-fingerprint
|
||||||
java-packages-fingerprint:
|
java-packages-fingerprint:
|
||||||
@cd imgbom/cataloger/java/test-fixtures/java-builds && \
|
@cd syft/cataloger/java/test-fixtures/java-builds && \
|
||||||
make packages.fingerprint
|
make packages.fingerprint
|
||||||
|
|
||||||
.PHONY: clear-test-cache
|
.PHONY: clear-test-cache
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
# imgbom (TBD Name)
|
# syft
|
||||||
|
|
||||||
|
A CLI tool and go library for generating a Software Bill of Materials from container images and filesystems.
|
||||||
|
|
18
cmd/cmd.go
18
cmd/cmd.go
|
@ -6,15 +6,15 @@ import (
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/presenter"
|
"github.com/anchore/syft/syft/presenter"
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
"github.com/anchore/syft/syft/scope"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom"
|
|
||||||
"github.com/anchore/imgbom/internal/config"
|
|
||||||
"github.com/anchore/imgbom/internal/format"
|
|
||||||
"github.com/anchore/imgbom/internal/log"
|
|
||||||
"github.com/anchore/imgbom/internal/logger"
|
|
||||||
"github.com/anchore/stereoscope"
|
"github.com/anchore/stereoscope"
|
||||||
|
"github.com/anchore/syft/internal/config"
|
||||||
|
"github.com/anchore/syft/internal/format"
|
||||||
|
"github.com/anchore/syft/internal/log"
|
||||||
|
"github.com/anchore/syft/internal/logger"
|
||||||
|
"github.com/anchore/syft/syft"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"github.com/wagoodman/go-partybus"
|
"github.com/wagoodman/go-partybus"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
|
@ -99,7 +99,7 @@ func initLogging() {
|
||||||
}
|
}
|
||||||
|
|
||||||
logWrapper := logger.NewZapLogger(config)
|
logWrapper := logger.NewZapLogger(config)
|
||||||
imgbom.SetLogger(logWrapper)
|
syft.SetLogger(logWrapper)
|
||||||
stereoscope.SetLogger(logWrapper)
|
stereoscope.SetLogger(logWrapper)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,5 +118,5 @@ func initEventBus() {
|
||||||
eventSubscription = eventBus.Subscribe()
|
eventSubscription = eventBus.Subscribe()
|
||||||
|
|
||||||
stereoscope.SetBus(eventBus)
|
stereoscope.SetBus(eventBus)
|
||||||
imgbom.SetBus(eventBus)
|
syft.SetBus(eventBus)
|
||||||
}
|
}
|
||||||
|
|
18
cmd/root.go
18
cmd/root.go
|
@ -4,14 +4,14 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom"
|
"github.com/anchore/syft/internal"
|
||||||
"github.com/anchore/imgbom/imgbom/event"
|
"github.com/anchore/syft/internal/bus"
|
||||||
"github.com/anchore/imgbom/imgbom/presenter"
|
"github.com/anchore/syft/internal/log"
|
||||||
"github.com/anchore/imgbom/internal"
|
"github.com/anchore/syft/internal/ui"
|
||||||
"github.com/anchore/imgbom/internal/bus"
|
"github.com/anchore/syft/internal/version"
|
||||||
"github.com/anchore/imgbom/internal/log"
|
"github.com/anchore/syft/syft"
|
||||||
"github.com/anchore/imgbom/internal/ui"
|
"github.com/anchore/syft/syft/event"
|
||||||
"github.com/anchore/imgbom/internal/version"
|
"github.com/anchore/syft/syft/presenter"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/wagoodman/go-partybus"
|
"github.com/wagoodman/go-partybus"
|
||||||
)
|
)
|
||||||
|
@ -58,7 +58,7 @@ func startWorker(userInput string) <-chan error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
catalog, scope, _, err := imgbom.Catalog(userInput, appConfig.ScopeOpt)
|
catalog, scope, _, err := syft.Catalog(userInput, appConfig.ScopeOpt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errs <- fmt.Errorf("failed to catalog input: %+v", err)
|
errs <- fmt.Errorf("failed to catalog input: %+v", err)
|
||||||
return
|
return
|
||||||
|
|
|
@ -3,8 +3,8 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/internal"
|
"github.com/anchore/syft/internal"
|
||||||
"github.com/anchore/imgbom/internal/version"
|
"github.com/anchore/syft/internal/version"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
||||||
module github.com/anchore/imgbom
|
module github.com/anchore/syft
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/adrg/xdg"
|
"github.com/adrg/xdg"
|
||||||
"github.com/anchore/imgbom/imgbom/presenter"
|
"github.com/anchore/syft/internal"
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
"github.com/anchore/syft/syft/presenter"
|
||||||
"github.com/anchore/imgbom/internal"
|
"github.com/anchore/syft/syft/scope"
|
||||||
"github.com/mitchellh/go-homedir"
|
"github.com/mitchellh/go-homedir"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package internal
|
package internal
|
||||||
|
|
||||||
// note: must be a single word, all lowercase
|
// note: must be a single word, all lowercase
|
||||||
const ApplicationName = "imgbom"
|
const ApplicationName = "syft"
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/internal"
|
"github.com/anchore/syft/internal"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/internal/log"
|
"github.com/anchore/syft/internal/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ZipFileManifest map[string]os.FileInfo
|
type ZipFileManifest map[string]os.FileInfo
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/internal/log"
|
"github.com/anchore/syft/internal/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -67,7 +67,7 @@ func equal(r1, r2 io.Reader) (bool, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUnzipToDir(t *testing.T) {
|
func TestUnzipToDir(t *testing.T) {
|
||||||
archivePrefix, err := ioutil.TempFile("", "imgbom-ziputil-archive-TEST-")
|
archivePrefix, err := ioutil.TempFile("", "syft-ziputil-archive-TEST-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to create tempfile: %+v", err)
|
t.Fatalf("unable to create tempfile: %+v", err)
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ func TestUnzipToDir(t *testing.T) {
|
||||||
|
|
||||||
generateFixture(t, archivePrefix.Name())
|
generateFixture(t, archivePrefix.Name())
|
||||||
|
|
||||||
contentsDir, err := ioutil.TempDir("", "imgbom-ziputil-contents-TEST-")
|
contentsDir, err := ioutil.TempDir("", "syft-ziputil-contents-TEST-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to create tempdir: %+v", err)
|
t.Fatalf("unable to create tempdir: %+v", err)
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ func TestUnzipToDir(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExtractFilesFromZipFile(t *testing.T) {
|
func TestExtractFilesFromZipFile(t *testing.T) {
|
||||||
archivePrefix, err := ioutil.TempFile("", "imgbom-ziputil-archive-TEST-")
|
archivePrefix, err := ioutil.TempFile("", "syft-ziputil-archive-TEST-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to create tempfile: %+v", err)
|
t.Fatalf("unable to create tempfile: %+v", err)
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ func TestExtractFilesFromZipFile(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestZipFileManifest(t *testing.T) {
|
func TestZipFileManifest(t *testing.T) {
|
||||||
archivePrefix, err := ioutil.TempFile("", "imgbom-ziputil-archive-TEST-")
|
archivePrefix, err := ioutil.TempFile("", "syft-ziputil-archive-TEST-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to create tempfile: %+v", err)
|
t.Fatalf("unable to create tempfile: %+v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package log
|
package log
|
||||||
|
|
||||||
import "github.com/anchore/imgbom/imgbom/logger"
|
import "github.com/anchore/syft/syft/logger"
|
||||||
|
|
||||||
var Log logger.Logger = &nopLogger{}
|
var Log logger.Logger = &nopLogger{}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package logger
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/internal/format"
|
"github.com/anchore/syft/internal/format"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,13 +4,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
imgbomEventParsers "github.com/anchore/imgbom/imgbom/event/parsers"
|
syftEventParsers "github.com/anchore/syft/syft/event/parsers"
|
||||||
"github.com/wagoodman/go-partybus"
|
"github.com/wagoodman/go-partybus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CatalogerFinishedHandler(event partybus.Event) error {
|
func CatalogerFinishedHandler(event partybus.Event) error {
|
||||||
// show the report to stdout
|
// show the report to stdout
|
||||||
pres, err := imgbomEventParsers.ParseCatalogerFinished(event)
|
pres, err := syftEventParsers.ParseCatalogerFinished(event)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("bad CatalogerFinished event: %w", err)
|
return fmt.Errorf("bad CatalogerFinished event: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,10 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
imgbomEvent "github.com/anchore/imgbom/imgbom/event"
|
|
||||||
"github.com/anchore/imgbom/internal/log"
|
|
||||||
"github.com/anchore/imgbom/internal/ui/common"
|
|
||||||
stereoscopeEvent "github.com/anchore/stereoscope/pkg/event"
|
stereoscopeEvent "github.com/anchore/stereoscope/pkg/event"
|
||||||
|
"github.com/anchore/syft/internal/log"
|
||||||
|
"github.com/anchore/syft/internal/ui/common"
|
||||||
|
syftEvent "github.com/anchore/syft/syft/event"
|
||||||
"github.com/wagoodman/go-partybus"
|
"github.com/wagoodman/go-partybus"
|
||||||
"github.com/wagoodman/jotframe/pkg/frame"
|
"github.com/wagoodman/jotframe/pkg/frame"
|
||||||
)
|
)
|
||||||
|
@ -68,7 +68,7 @@ eventLoop:
|
||||||
break eventLoop
|
break eventLoop
|
||||||
}
|
}
|
||||||
switch e.Type {
|
switch e.Type {
|
||||||
case imgbomEvent.AppUpdateAvailable:
|
case syftEvent.AppUpdateAvailable:
|
||||||
err = appUpdateAvailableHandler(ctx, fr, e, wg)
|
err = appUpdateAvailableHandler(ctx, fr, e, wg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("unable to show AppUpdateAvailable event: %+v", err)
|
log.Errorf("unable to show AppUpdateAvailable event: %+v", err)
|
||||||
|
@ -86,12 +86,12 @@ eventLoop:
|
||||||
log.Errorf("unable to show FetchImage event: %+v", err)
|
log.Errorf("unable to show FetchImage event: %+v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
case imgbomEvent.CatalogerStarted:
|
case syftEvent.CatalogerStarted:
|
||||||
err = catalogerStartedHandler(ctx, fr, e, wg)
|
err = catalogerStartedHandler(ctx, fr, e, wg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("unable to show CatalogerStarted event: %+v", err)
|
log.Errorf("unable to show CatalogerStarted event: %+v", err)
|
||||||
}
|
}
|
||||||
case imgbomEvent.CatalogerFinished:
|
case syftEvent.CatalogerFinished:
|
||||||
// we may have other background processes still displaying progress, wait for them to
|
// we may have other background processes still displaying progress, wait for them to
|
||||||
// finish before discontinuing dynamic content and showing the final report
|
// finish before discontinuing dynamic content and showing the final report
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
imgbomEventParsers "github.com/anchore/imgbom/imgbom/event/parsers"
|
|
||||||
stereoEventParsers "github.com/anchore/stereoscope/pkg/event/parsers"
|
stereoEventParsers "github.com/anchore/stereoscope/pkg/event/parsers"
|
||||||
|
syftEventParsers "github.com/anchore/syft/syft/event/parsers"
|
||||||
"github.com/gookit/color"
|
"github.com/gookit/color"
|
||||||
"github.com/wagoodman/go-partybus"
|
"github.com/wagoodman/go-partybus"
|
||||||
"github.com/wagoodman/go-progress"
|
"github.com/wagoodman/go-progress"
|
||||||
|
@ -111,7 +111,7 @@ func imageReadHandler(ctx context.Context, fr *frame.Frame, event partybus.Event
|
||||||
}
|
}
|
||||||
|
|
||||||
func catalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error {
|
func catalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error {
|
||||||
monitor, err := imgbomEventParsers.ParseCatalogerStarted(event)
|
monitor, err := syftEventParsers.ParseCatalogerStarted(event)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("bad CatalogerStarted event: %w", err)
|
return fmt.Errorf("bad CatalogerStarted event: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ func catalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybu
|
||||||
}
|
}
|
||||||
|
|
||||||
func appUpdateAvailableHandler(_ context.Context, fr *frame.Frame, event partybus.Event, _ *sync.WaitGroup) error {
|
func appUpdateAvailableHandler(_ context.Context, fr *frame.Frame, event partybus.Event, _ *sync.WaitGroup) error {
|
||||||
newVersion, err := imgbomEventParsers.ParseAppUpdateAvailable(event)
|
newVersion, err := syftEventParsers.ParseAppUpdateAvailable(event)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("bad AppUpdateAvailable event: %w", err)
|
return fmt.Errorf("bad AppUpdateAvailable event: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package ui
|
package ui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
imgbomEvent "github.com/anchore/imgbom/imgbom/event"
|
"github.com/anchore/syft/internal/log"
|
||||||
"github.com/anchore/imgbom/internal/log"
|
"github.com/anchore/syft/internal/ui/common"
|
||||||
"github.com/anchore/imgbom/internal/ui/common"
|
syftEvent "github.com/anchore/syft/syft/event"
|
||||||
"github.com/wagoodman/go-partybus"
|
"github.com/wagoodman/go-partybus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ eventLoop:
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore all events except for the final event
|
// ignore all events except for the final event
|
||||||
if e.Type == imgbomEvent.CatalogerFinished {
|
if e.Type == syftEvent.CatalogerFinished {
|
||||||
err := common.CatalogerFinishedHandler(e)
|
err := common.CatalogerFinishedHandler(e)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("unable to show catalog image finished event: %+v", err)
|
log.Errorf("unable to show catalog image finished event: %+v", err)
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/internal/ui/etui"
|
"github.com/anchore/syft/internal/ui/etui"
|
||||||
"golang.org/x/crypto/ssh/terminal"
|
"golang.org/x/crypto/ssh/terminal"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ var latestAppVersionURL = struct {
|
||||||
}{
|
}{
|
||||||
// TODO: set me to release host/path before release
|
// TODO: set me to release host/path before release
|
||||||
host: "https://anchore.io",
|
host: "https://anchore.io",
|
||||||
path: "/imgbom/releases/latest/VERSION",
|
path: "/syft/releases/latest/VERSION",
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsUpdateAvailable() (bool, string, error) {
|
func IsUpdateAvailable() (bool, string, error) {
|
||||||
|
|
2
main.go
2
main.go
|
@ -1,7 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/cmd"
|
"github.com/anchore/syft/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package apkdb
|
package apkdb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/common"
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/common"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cataloger struct {
|
type Cataloger struct {
|
|
@ -9,7 +9,7 @@ import (
|
||||||
|
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func parseApkDB(_ string, reader io.Reader) ([]pkg.Package, error) {
|
func parseApkDB(_ string, reader io.Reader) ([]pkg.Package, error) {
|
|
@ -7,7 +7,7 @@ import (
|
||||||
|
|
||||||
"github.com/go-test/deep"
|
"github.com/go-test/deep"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSinglePackage(t *testing.T) {
|
func TestSinglePackage(t *testing.T) {
|
|
@ -1,10 +1,10 @@
|
||||||
package bundler
|
package bundler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/common"
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/common"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cataloger struct {
|
type Cataloger struct {
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/internal"
|
||||||
"github.com/anchore/imgbom/internal"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
var sectionsOfInterest = internal.NewStringSetFromSlice([]string{"GEM"})
|
var sectionsOfInterest = internal.NewStringSetFromSlice([]string{"GEM"})
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
var expected = map[string]string{
|
var expected = map[string]string{
|
|
@ -1,9 +1,9 @@
|
||||||
package cataloger
|
package cataloger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cataloger interface {
|
type Cataloger interface {
|
|
@ -3,10 +3,10 @@ package common
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/imgbom/internal/log"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/internal/log"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GenericCataloger implements the Catalog interface and is responsible for dispatching the proper parser function for
|
// GenericCataloger implements the Catalog interface and is responsible for dispatching the proper parser function for
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/internal"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/internal"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
type testResolver struct {
|
type testResolver struct {
|
|
@ -3,7 +3,7 @@ package common
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ParserFn standardizes a function signature for parser functions that accept the virtual file path (not usable for file reads) and contents and return any discovered packages from that file
|
// ParserFn standardizes a function signature for parser functions that accept the virtual file path (not usable for file reads) and contents and return any discovered packages from that file
|
|
@ -1,20 +1,20 @@
|
||||||
package cataloger
|
package cataloger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/apkdb"
|
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/bundler"
|
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/dpkg"
|
|
||||||
golang "github.com/anchore/imgbom/imgbom/cataloger/golang"
|
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/java"
|
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/npm"
|
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/python"
|
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/rpmdb"
|
|
||||||
"github.com/anchore/imgbom/imgbom/event"
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/imgbom/internal/bus"
|
|
||||||
"github.com/anchore/imgbom/internal/log"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/internal/bus"
|
||||||
|
"github.com/anchore/syft/internal/log"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/apkdb"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/bundler"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/dpkg"
|
||||||
|
golang "github.com/anchore/syft/syft/cataloger/golang"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/java"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/npm"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/python"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/rpmdb"
|
||||||
|
"github.com/anchore/syft/syft/event"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/wagoodman/go-partybus"
|
"github.com/wagoodman/go-partybus"
|
||||||
"github.com/wagoodman/go-progress"
|
"github.com/wagoodman/go-progress"
|
|
@ -1,10 +1,10 @@
|
||||||
package dpkg
|
package dpkg
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/common"
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/common"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cataloger struct {
|
type Cataloger struct {
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
"github.com/go-test/deep"
|
"github.com/go-test/deep"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package golang
|
package golang
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/common"
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/common"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cataloger struct {
|
type Cataloger struct {
|
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
"github.com/rogpeppe/go-internal/modfile"
|
"github.com/rogpeppe/go-internal/modfile"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func parseGoMod(path string, reader io.Reader) ([]pkg.Package, error) {
|
func parseGoMod(path string, reader io.Reader) ([]pkg.Package, error) {
|
|
@ -6,7 +6,7 @@ import (
|
||||||
|
|
||||||
"github.com/go-test/deep"
|
"github.com/go-test/deep"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParseGoMod(t *testing.T) {
|
func TestParseGoMod(t *testing.T) {
|
|
@ -1,5 +1,5 @@
|
||||||
module (
|
module (
|
||||||
github.com/anchore/imgbom
|
github.com/anchore/syft
|
||||||
)
|
)
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
|
@ -1,4 +1,4 @@
|
||||||
module github.com/anchore/imgbom
|
module github.com/anchore/syft
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|
|
@ -5,9 +5,9 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/internal/log"
|
"github.com/anchore/syft/internal/log"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
// match examples:
|
// match examples:
|
|
@ -1,7 +1,7 @@
|
||||||
package java
|
package java
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
"github.com/sergi/go-diff/diffmatchpatch"
|
"github.com/sergi/go-diff/diffmatchpatch"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
|
@ -5,9 +5,9 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/internal"
|
||||||
"github.com/anchore/imgbom/internal"
|
"github.com/anchore/syft/internal/file"
|
||||||
"github.com/anchore/imgbom/internal/file"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
var archiveFormatGlobs = []string{
|
var archiveFormatGlobs = []string{
|
|
@ -11,9 +11,9 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/internal"
|
"github.com/anchore/syft/internal"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
"github.com/go-test/deep"
|
"github.com/go-test/deep"
|
||||||
"github.com/gookit/color"
|
"github.com/gookit/color"
|
||||||
)
|
)
|
|
@ -1,10 +1,10 @@
|
||||||
package java
|
package java
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/common"
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/common"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cataloger struct {
|
type Cataloger struct {
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,7 +2,7 @@ package java
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
"github.com/go-test/deep"
|
"github.com/go-test/deep"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,7 +2,7 @@ package java
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
"github.com/go-test/deep"
|
"github.com/go-test/deep"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
|
@ -7,11 +7,11 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/internal/log"
|
"github.com/anchore/syft/internal/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func saveArchiveToTmp(reader io.Reader) (string, string, func(), error) {
|
func saveArchiveToTmp(reader io.Reader) (string, string, func(), error) {
|
||||||
tempDir, err := ioutil.TempDir("", "imgbom-jar-contents-")
|
tempDir, err := ioutil.TempDir("", "syft-jar-contents-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", func() {}, fmt.Errorf("unable to create tempdir for jar processing: %w", err)
|
return "", "", func() {}, fmt.Errorf("unable to create tempdir for jar processing: %w", err)
|
||||||
}
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
package npm
|
package npm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/common"
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/common"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cataloger struct {
|
type Cataloger struct {
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PackageLock struct {
|
type PackageLock struct {
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func assertPkgsEqual(t *testing.T, actual []pkg.Package, expected map[string]pkg.Package) {
|
func assertPkgsEqual(t *testing.T, actual []pkg.Package, expected map[string]pkg.Package) {
|
|
@ -1,10 +1,10 @@
|
||||||
package python
|
package python
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anchore/imgbom/imgbom/cataloger/common"
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
|
||||||
"github.com/anchore/imgbom/imgbom/scope"
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
|
"github.com/anchore/syft/syft/cataloger/common"
|
||||||
|
"github.com/anchore/syft/syft/pkg"
|
||||||
|
"github.com/anchore/syft/syft/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cataloger struct {
|
type Cataloger struct {
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func parseRequirementsTxt(_ string, reader io.Reader) ([]pkg.Package, error) {
|
func parseRequirementsTxt(_ string, reader io.Reader) ([]pkg.Package, error) {
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParseRequirementsTxt(t *testing.T) {
|
func TestParseRequirementsTxt(t *testing.T) {
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anchore/imgbom/imgbom/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func parseWheelMetadata(_ string, reader io.Reader) ([]pkg.Package, error) {
|
func parseWheelMetadata(_ string, reader io.Reader) ([]pkg.Package, error) {
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue