Skip to content

Commit

Permalink
Merge branch 'anchore:main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
tomersein authored Jan 5, 2025
2 parents 661e279 + e5326ca commit 9e54256
Show file tree
Hide file tree
Showing 127 changed files with 2,307 additions and 1,163 deletions.
6 changes: 3 additions & 3 deletions .binny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tools:
# used for linting
- name: golangci-lint
version:
want: v1.62.2
want: v1.63.3
method: github-release
with:
repo: golangci/golangci-lint
Expand Down Expand Up @@ -58,7 +58,7 @@ tools:
# used to release all artifacts
- name: goreleaser
version:
want: v2.4.8
want: v2.5.1
method: github-release
with:
repo: goreleaser/goreleaser
Expand Down Expand Up @@ -98,7 +98,7 @@ tools:
# used for triggering a release
- name: gh
version:
want: v2.63.2
want: v2.64.0
method: github-release
with:
repo: cli/cli
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@babb554ede22fd5605947329c4d04d8e7a0b8155 # v3.27.7
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -85,4 +85,4 @@ jobs:
run: make grype

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@babb554ede22fd5605947329c4d04d8e7a0b8155 # v3.27.7
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
# for updating brew formula in anchore/homebrew-syft
GITHUB_BREW_TOKEN: ${{ secrets.ANCHOREOPS_GITHUB_OSS_WRITE_TOKEN }}

- uses: anchore/sbom-action@55dc4ee22412511ee8c3142cbea40418e6cec693 # v0.17.8
- uses: anchore/sbom-action@df80a981bc6edbc4e220a492d3cbe9f5547a6e75 # v0.17.9
continue-on-error: true
with:
artifact-name: sbom.spdx.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@babb554ede22fd5605947329c4d04d8e7a0b8155 # v1.0.26
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v1.0.26
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/update-anchore-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
app_id: ${{ secrets.TOKEN_APP_ID }}
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}

- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f #v7.0.5
- uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f #v7.0.6
with:
signoff: true
delete-branch: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-bootstrap-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
app_id: ${{ secrets.TOKEN_APP_ID }}
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}

- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f #v7.0.5
- uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f #v7.0.6
with:
signoff: true
delete-branch: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-quality-gate-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
app_id: ${{ secrets.TOKEN_APP_ID }}
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}

- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f #v7.0.5
- uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f #v7.0.6
with:
signoff: true
delete-branch: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

- name: Upload the provider state archive
if: ${{ failure() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: qg-capture-state
path: qg-capture-state.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Checksums are applied to all artifacts, and the resulting checksum file is signe

You need the following tool to verify signature:

- [Cosign](https://docs.sigstore.dev/cosign/installation/)
- [Cosign](https://docs.sigstore.dev/cosign/system_config/installation/)

Verification steps are as follow:

Expand Down
2 changes: 1 addition & 1 deletion cmd/grype/cli/commands/db_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/anchore/clio"
"github.com/anchore/grype/cmd/grype/cli/options"
"github.com/anchore/grype/grype/db/legacy/distribution"
"github.com/anchore/grype/grype/differ"
"github.com/anchore/grype/grype/db/v5/differ"
"github.com/anchore/grype/internal/bus"
"github.com/anchore/grype/internal/log"
)
Expand Down
16 changes: 10 additions & 6 deletions cmd/grype/cli/commands/db_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import (
"github.com/anchore/grype/grype/db/v6/distribution"
"github.com/anchore/grype/grype/db/v6/installation"
"github.com/anchore/grype/internal"
"github.com/anchore/grype/internal/log"
)

func DBImport(app clio.Application) *cobra.Command {
opts := dbOptionsDefault(app.ID())

return app.SetupCommand(&cobra.Command{
Use: "import FILE",
Short: "import a vulnerability database archive",
Long: fmt.Sprintf("import a vulnerability database archive from a local FILE.\nDB archives can be obtained from %q.", internal.DBUpdateURL),
Args: cobra.ExactArgs(1),
PreRunE: disableUI(app),
Use: "import FILE",
Short: "import a vulnerability database archive",
Long: fmt.Sprintf("import a vulnerability database archive from a local FILE.\nDB archives can be obtained from %q.", internal.DBUpdateURL),
Args: cobra.ExactArgs(1),
RunE: func(_ *cobra.Command, args []string) error {
return runDBImport(*opts, args[0])
},
Expand All @@ -48,10 +48,14 @@ func newDBImport(opts options.Database, dbArchivePath string) error {
return fmt.Errorf("unable to create curator: %w", err)
}

log.WithFields("path", dbArchivePath).Infof("importing vulnerability database archive")
if err := c.Import(dbArchivePath); err != nil {
return fmt.Errorf("unable to import vulnerability database: %w", err)
}
return stderrPrintLnf("Vulnerability database imported")

s := c.Status()
log.WithFields("built", s.Built.String(), "status", s.Status()).Info("vulnerability database imported")
return nil
}

func legacyDBImport(opts options.Database, dbArchivePath string) error {
Expand Down
14 changes: 2 additions & 12 deletions cmd/grype/cli/commands/db_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,13 @@ func newDBStatus(opts dbStatusOptions) error {
}

func presentDBStatus(format string, writer io.Writer, status v6.Status) error {
statusStr := "valid"
if status.Err != nil {
statusStr = "invalid"
}

switch format {
case textOutputFormat:
fmt.Fprintln(writer, "Path: ", status.Path)
fmt.Fprintln(writer, "Schema: ", status.SchemaVersion)
fmt.Fprintln(writer, "Built: ", status.Built.String())
fmt.Fprintln(writer, "Checksum: ", status.Checksum)
fmt.Fprintln(writer, "Status: ", statusStr)
fmt.Fprintln(writer, "Status: ", status.Status())
case jsonOutputFormat:
enc := json.NewEncoder(writer)
enc.SetEscapeHTML(false)
Expand All @@ -107,18 +102,13 @@ func legacyDBStatus(opts dbStatusOptions) error {

status := dbCurator.Status()

statusStr := "valid"
if status.Err != nil {
statusStr = "invalid"
}

switch opts.Output {
case textOutputFormat:
fmt.Println("Location: ", status.Location)
fmt.Println("Built: ", status.Built.String())
fmt.Println("Schema: ", status.SchemaVersion)
fmt.Println("Checksum: ", status.Checksum)
fmt.Println("Status: ", statusStr)
fmt.Println("Status: ", status.Status())
case jsonOutputFormat:
enc := json.NewEncoder(os.Stdout)
enc.SetEscapeHTML(false)
Expand Down
20 changes: 10 additions & 10 deletions cmd/grype/cli/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ import (
"github.com/anchore/grype/cmd/grype/cli/options"
"github.com/anchore/grype/grype"
"github.com/anchore/grype/grype/db/legacy/distribution"
v5 "github.com/anchore/grype/grype/db/v5"
"github.com/anchore/grype/grype/db/v5/matcher"
"github.com/anchore/grype/grype/db/v5/matcher/dotnet"
"github.com/anchore/grype/grype/db/v5/matcher/golang"
"github.com/anchore/grype/grype/db/v5/matcher/java"
"github.com/anchore/grype/grype/db/v5/matcher/javascript"
"github.com/anchore/grype/grype/db/v5/matcher/python"
"github.com/anchore/grype/grype/db/v5/matcher/ruby"
"github.com/anchore/grype/grype/db/v5/matcher/stock"
"github.com/anchore/grype/grype/event"
"github.com/anchore/grype/grype/event/parsers"
"github.com/anchore/grype/grype/grypeerr"
"github.com/anchore/grype/grype/match"
"github.com/anchore/grype/grype/matcher"
"github.com/anchore/grype/grype/matcher/dotnet"
"github.com/anchore/grype/grype/matcher/golang"
"github.com/anchore/grype/grype/matcher/java"
"github.com/anchore/grype/grype/matcher/javascript"
"github.com/anchore/grype/grype/matcher/python"
"github.com/anchore/grype/grype/matcher/ruby"
"github.com/anchore/grype/grype/matcher/stock"
"github.com/anchore/grype/grype/pkg"
"github.com/anchore/grype/grype/presenter/models"
"github.com/anchore/grype/grype/store"
"github.com/anchore/grype/grype/vex"
"github.com/anchore/grype/grype/vulnerability"
"github.com/anchore/grype/internal"
Expand Down Expand Up @@ -118,7 +118,7 @@ func runGrype(app clio.Application, opts *options.Grype, userInput string) (errs
return err
}

var str *store.Store
var str *v5.ProviderStore
var status *distribution.Status
var packages []pkg.Package
var s *sbom.SBOM
Expand Down
2 changes: 1 addition & 1 deletion cmd/grype/cli/options/datasources.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package options

import (
"github.com/anchore/clio"
"github.com/anchore/grype/grype/matcher/java"
"github.com/anchore/grype/grype/db/v5/matcher/java"
)

const (
Expand Down
27 changes: 14 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/anchore/grype
go 1.23.2

require (
github.com/CycloneDX/cyclonedx-go v0.9.1
github.com/CycloneDX/cyclonedx-go v0.9.2
github.com/Masterminds/sprig/v3 v3.3.0
github.com/OneOfOne/xxhash v1.2.8
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
Expand All @@ -16,18 +16,18 @@ require (
github.com/anchore/go-testutils v0.0.0-20200925183923-d5f45b0d3c04
github.com/anchore/go-version v1.2.2-0.20210903204242-51efa5b487c4
github.com/anchore/packageurl-go v0.1.1-0.20241018175412-5c22e6360c4f
github.com/anchore/stereoscope v0.0.10
github.com/anchore/syft v1.18.1-0.20241210183324-561ed50c2d20
github.com/anchore/stereoscope v0.0.11
github.com/anchore/syft v1.18.1
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46
github.com/bmatcuk/doublestar/v2 v2.0.4
github.com/charmbracelet/bubbletea v1.2.4
github.com/charmbracelet/lipgloss v1.0.0
github.com/dave/jennifer v1.7.1
github.com/docker/docker v27.4.0+incompatible
github.com/docker/docker v27.4.1+incompatible
github.com/dustin/go-humanize v1.0.1
github.com/facebookincubator/nvdtools v0.1.5
github.com/gabriel-vasile/mimetype v1.4.7
github.com/gkampitakis/go-snaps v0.5.7
github.com/gkampitakis/go-snaps v0.5.8
github.com/glebarez/sqlite v1.11.0
github.com/go-test/deep v1.1.1
github.com/google/go-cmp v0.6.0
Expand Down Expand Up @@ -80,7 +80,7 @@ require (
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.11.7 // indirect
github.com/ProtonMail/go-crypto v1.1.2 // indirect
github.com/ProtonMail/go-crypto v1.1.3 // indirect
github.com/acobaugh/osrelease v0.1.0 // indirect
github.com/anchore/fangs v0.0.0-20241014225144-4e1713cafd77 // indirect
github.com/anchore/go-macholibre v0.0.0-20220308212642-53e6d0aaf6fb // indirect
Expand Down Expand Up @@ -113,7 +113,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v27.3.1+incompatible // indirect
github.com/docker/cli v27.4.0+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
Expand All @@ -128,7 +128,7 @@ require (
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/github/go-spdx/v2 v2.3.2 // indirect
github.com/gkampitakis/ciinfo v0.3.0 // indirect
github.com/gkampitakis/ciinfo v0.3.1 // indirect
github.com/gkampitakis/go-diff v1.3.2 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
Expand All @@ -137,6 +137,7 @@ require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-restruct/restruct v1.2.0-alpha // indirect
github.com/goccy/go-yaml v1.15.13 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
Expand Down Expand Up @@ -205,7 +206,7 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/saferwall/pe v1.5.6 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
Expand All @@ -222,10 +223,10 @@ require (
github.com/spf13/viper v1.19.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/sylabs/sif/v2 v2.20.0 // indirect
github.com/sylabs/squashfs v1.0.0 // indirect
github.com/sylabs/sif/v2 v2.20.1 // indirect
github.com/sylabs/squashfs v1.0.4 // indirect
github.com/therootcompany/xz v1.0.1 // indirect
github.com/tidwall/gjson v1.17.0 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
Expand All @@ -244,7 +245,7 @@ require (
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.30.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/oauth2 v0.19.0 // indirect
Expand Down
Loading

0 comments on commit 9e54256

Please sign in to comment.