Commit graph

719 commits

Author SHA1 Message Date
Christopher Angelo Phillips
00aa7d4523
Add private registry authorization section to README (#488)
* update registry auth section for readme

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-11-04 14:37:07 +00:00
Alex Goodman
3d7c38c670
bump syft to v0.29.0 (#487)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-11-02 14:42:51 -04:00
Alex Goodman
afc9de6058
Fix hang when running as a subprocess (#484)
* use named pipe bit on stdin as indicator for piped input

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* ensure stdin is ignored when the CLI hints are present

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* add CLI test to cover subprocess integration behavior

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* added test case for java regression

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* remove extra line in makefile

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-29 14:51:58 +00:00
Christopher Angelo Phillips
9349060765
Add QEMU to acceptance tests flow (#483)
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-26 11:51:53 -04:00
Christopher Angelo Phillips
9d245e3d9d
update CI regression and add docker manifests (#479)
* see if QEMU offers support

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* update QEMU support before cli verification

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-26 10:04:38 -04:00
Alex Goodman
c9a1506ede
add arm64 support to install.sh (#480)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-25 22:09:49 +00:00
Christopher Angelo Phillips
d4bcf161b5
Add arm64 image support and Darwin M1 support to .goreleaser.yaml (#477)
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-25 16:56:55 +00:00
Alex Goodman
9c00165306
pull in space suffix fix (#475)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-25 10:14:37 -04:00
Christopher Angelo Phillips
9cd917d29c
Add windows support (#464)
* update grype to compile windows

Signed-off-by: spiffcs <christopher.phillips@anchore.com>
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* update go mod with new stereoscope

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* update build comments

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* small build tags

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* add goreleaser windows

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* bump syft version

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* update tests

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* update test images to use newest pinned golang

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-22 13:46:56 -04:00
Alex Goodman
25af951580
force exiting the etui upon worker error (#472)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-22 13:45:07 -04:00
Dan Luhring
e4bc82f305
Readme improvements (#469)
* Remove webinar announcement

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Document only-fixed feature

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Expand docs for Grype database

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* List out allowed values for fix-state

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-10-22 12:07:06 +00:00
Alex Goodman
1e7218b01f
add chronicle as changelog generator (#468)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-21 16:30:24 -04:00
Christopher Angelo Phillips
441a643b15
362 add binary for linux arm64 to release process (#465)
* add binary for arm64 to release process

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* update from darwin -> linux

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-20 17:11:14 -04:00
Alex Goodman
f75889c694
Disable ETUI when piping input (#463)
* disable etui when piping input

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* restore jotframe version

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* remove test code

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* raise error from IsPipedInput

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* factor out verbosity check to function

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-20 12:40:57 -04:00
Dan Luhring
19a513a42a
Silence usage and errors on root command (#462)
* Silence usage and errors on root command

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* show help when no args are given

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* remove comments

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* add cli test for help behavior

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-20 09:50:59 -04:00
Christopher Angelo Phillips
637a061532
Add APK version constraint parsing (#455)
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-18 17:27:02 +00:00
Alex Goodman
dc1f682e4b
remove unnecessary codeql checkout from second parent commit (#458)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-18 13:18:56 -04:00
Christopher Angelo Phillips
4682dcc2f4
add presenter tests for ignore functionality (#459)
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-18 16:04:27 +00:00
Christopher Angelo Phillips
30340dbdf6
175 patch - allow ignore not fixed to work independently of configured rules (#454)
* add ignore rules that allow different states of fixes to be ignored

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-18 09:46:12 -04:00
Dan Luhring
e544dff368
Announce upcoming webinar (#457)
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-10-15 16:21:26 +00:00
Dan Luhring
438c4f899f
Add Grype logo (#451)
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-10-11 21:15:19 +00:00
Christopher Angelo Phillips
bed8bab572
(#175) add only fixed option (#448)
Add --only-fixed option to root command. Grype will now exit with status code 0 when passing this option if vulnerabilities are detected but have no upstream resolution.

* update config with new option

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* add flag into root cmd

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-11 11:30:01 -04:00
Sam Dacanay
2dd41311cb
Retrieve target from directory sbom types in addition to image types (#440)
* Retrieve target from directory sbom types in addition to image types

Signed-off-by: Samuel Dacanay <sam.dacanay@anchore.com>

* add dir sbom ingest test

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-06 13:59:36 +00:00
Alex Goodman
6fe9fc2c8c
update linter + fix whitespace (#443)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-06 09:49:42 -04:00
Alex Goodman
cd3b414e59
Add option to output vulnerability report to a file (#442)
* add --file CLI option

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* tidy go sum

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-05 15:57:36 -04:00
Dan Luhring
84189278a3
Improve documentation (#441)
* Make installation methods more obvious

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Add badge for joining Slack

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Document requirement for signed commits

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-10-04 09:29:41 -04:00
Alex Goodman
b1f3be4520
Upgrade config, UI, and command package patterns (#406)
* split and upgrade config processing

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* upgrade UI organization

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* expose logger writter

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* add (unused) signal handler

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* add (unused) event loop abstraction

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* update aux commands to use Cobra RunE over Run

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* upgrade root command to use new event loop and signal handler

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* update CLI test to account for config representation

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* update dependencies + fix linting

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* decompose application config parse func + add missing config struct tags

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* restore unparam lint exclusion for registry config

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-01 13:03:50 -04:00
Vijay Pillai
34b4885b87
Make constraint tests uniform (#423)
* Move changes from kb_constraint_test.go to helper_test.go for uniform testing methodology across all constraint tests.

Signed-off-by: Vijay Pillai <vijay.pillai@anchore.com>

* refactor to go convention

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-01 10:57:07 -04:00
Conor Nosal
1c3605dfa6
Support gomod configuration in goreleaser (#391)
* Support gomod configuration in goreleaser

Signed-off-by: Conor Nosal <cnosal@vmware.com>

* switch to goreleaser build for snapshots + bump version

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* modify goreleaser buildx option due to deprecation

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* add snapshot flag to builds

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
2021-10-01 09:37:36 -04:00
Dan Luhring
682fb4482f
Update description for Slack link (#439)
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-09-30 21:45:22 +00:00
Zach Hill
bab3964ed9
Updates approach for epoch handling in rpm comparisons (#438)
* Updates approach for epoch handling in rpm comparisons to ignore epochs
if not explicitly available from both sides of comparison. Fixes #437

This approach adds -1 as epoch value in the struct to identify
"not-specified" rather than defaulting to 0, per rpm spec, so that the
comparison logic can identify when it is provided vs missing.

During the comparison if both sides to not have an explicitly set epoch
it will skip the epoch check as unreliable and compare the remaining
components. This is done to handle messy data in RedHat vuln feeds where
often the sourceRpm versions do not include epochs when they should, and
defaulting to zero or using the epoch of the binary version is also
incorrect.

Signed-off-by: Zach Hill <zach@anchore.com>

* Uses switch instead of if-else-chain per linter suggestion

Signed-off-by: Zach Hill <zach@anchore.com>

* Fix import order/format for linter

Signed-off-by: Zach Hill <zach@anchore.com>

* Comment out strictCompare for linter

Signed-off-by: Zach Hill <zach@anchore.com>

* Minor cleanup

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Remove commented out function

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Refactor RPM version comparison to make missing epoch explicit

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* More cleanup

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* change epoch to pointer type

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* add rpmdb matcher tests for explicit epoch being passed

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* explicitly pass the epoch on package versions in the rpmdb matcher

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

Co-authored-by: Dan Luhring <dan.luhring@anchore.com>
Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
2021-09-30 17:18:22 +00:00
Dan Luhring
f86fd7eb38
Feature: Specifying ignore rules for vulnerability matches (#430)
* Preliminary implementation of ignore rules

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Support ignoring matches by package type

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Add tests for ignore functionality

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Add documentation for ignore rules and clean up README

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Add test for glob location matching

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-09-29 15:44:36 -04:00
Dan Luhring
e6831d9444
Update Syft to v0.24.1 (#433)
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-09-28 16:55:50 -04:00
Alex Goodman
608e126dc6
pull in grype-db default language namespace namer + fix imbalanced version v prefixes (#434)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-09-28 16:55:27 -04:00
Alex Goodman
1db64eff72
add stock matcher (language + cpe matching) (#432)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-09-28 15:28:48 -04:00
Keith Zantow
1d08335bb3
Add SBOM to releases (#429)
Signed-off-by: Keith Zantow <kzantow@gmail.com>
2021-09-24 20:22:14 -04:00
Dan Luhring
2c79261c01
Add announcement for KubeCon meetup (#428)
* Add announcement for KubeCon meetup

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>

* Remove warning about zsh completion

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-09-24 15:50:57 +00:00
Dan Luhring
dd412b9a1a
Improve log message for CPE parsing error (#426)
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-09-23 09:32:07 -04:00
Vijay Pillai
1a7c9d1779
Bugfixes + Integration test for sbom input vs grype library comparison (#424)
This change both adds a test to identify and fixes differences between loading sboms from json and loading sboms from Syft as a library.
* adds integration test that compares SBOM input vs image input
* fix integration test cache path
* Add handler for ApkMetadataType in partialSyftPackage.UnmarshalJSON
* Fix Epoch missing from Package.New RpmdbMetadataType handler and update RpmDbMetadata test in TestNew_MetadataExtraction
* bump syft to version 0.24.0
* update license check for packageurl-go

Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
Co-authored-by: Vijay Pillai <vijay.pillai@anchore.com>

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Vijay Pillai <vijay.pillai@anchore.com>
2021-09-22 21:53:32 -04:00
Dan Luhring
119f4b0112
Allow CPE parsing failures (#425)
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-09-22 18:05:21 -04:00
Vijay Pillai
336b1f0f05
Update KB constraint to not satisfy if raw constraint is empty. (#421)
This change updates the KB constraint to not satisfy if raw constraint is empty.
Additional related changes:
* Implemented new NonFatalConstraintError and change kbConstraint.Satisfied to return an error if the version constraint is empty string.
* Re-implement TestVersionKbConstraint as test helper module helper_test.go does not satisfy testing needs.
* Add test to TestVersionKbConstraint for version "base" and constraint "base" to ensure unpatched microsoft images are matched.

Signed-off-by: Vijay Pillai <vijay.pillai@anchore.com>
2021-09-21 13:36:51 -04:00
Christopher Angelo Phillips
43c2d91f34
update log file permissions (#422)
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-09-21 12:14:38 -04:00
Christopher Angelo Phillips
fe00b3c314
Enhance version cmd with SYFT_VERSION (#420)
* update command to take in SYFT_VERSION

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* add dynamic input to build command for ci

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-09-16 16:08:07 -04:00
Vijay Pillai
7c082c2162
Add more unit tests for new trimQuotes function (#416)
* add more unit tests for trimQuotes function

Signed-off-by: Vijay Pillai <vijay.pillai@anchore.com>
2021-09-14 17:27:15 -04:00
Dan Palmer
83c6ee23a9
Update grype-db dependency, add some SLES tests (#413)
* Update grype-db dependency, add some SLES tests

Signed-off-by: Dan Palmer <dan.palmer@anchore.com>
2021-09-14 15:08:32 -04:00
Vijay Pillai
c272d8019e
Fix vulndb fuzzy constraint matching (#415)
Grype DB Builder was changed to use single quotes instead of double quotes for version constraints. This change broke constraint matching for vulndb records. This change fixes that by adding support for single quotes to the parseUnit function in grype/version/constraint_unit.go.

* Update constraint unit parser to remove single quotes as well as double quotes from a constraint unit. This will allow vulndb constratints to match again.
* Add unit test for quoted fuzzy constraints.

Signed-off-by: Vijay Pillai <vijay.pillai@anchore.com>
2021-09-13 17:55:01 -04:00
Christopher Angelo Phillips
f3e3e832a8
bump syft to the newest 0.23.0 version - tidy mod (#414)
* bump syft to the newest 0.23.0 version - tidy mod
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>

* update integration test to use new pointer
syft source.New() was changed to return a pointer
rather than value for 0.23.0 this commit updates our 
integration tests to reflect that change
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-09-13 16:46:41 -04:00
Zane Burstein
434a774106
Match against Alpine source packages (#407)
* Update go-version package and add test

This is being updated due to an issue that was encountered in the lessThanEqual constraint in go-version: https://github.com/anchore/go-version/pull/2. Was disovered while adding tests for apk origin package matching

Signed-off-by: Zane Burstein <zane.burstein@anchore.com>

* Added matching with source package for apk

This change allows grype to match with a packages source package for apk. Adds APKMetadata with OriginPackage, new matching logic in apk matchers, and tests

Signed-off-by: Zane Burstein <zane.burstein@anchore.com>
2021-09-09 07:42:11 -04:00
Zane Burstein
77b1da95fa
Merge pull request #411 from anchore/fix-goreleaser-install
Added goreleaser-install.sh and execution in make bootstrap target
2021-09-07 14:41:44 -07:00
Zane Burstein
d169d5292a Added goreleaser-install.sh and execution in make bootstrap target
Previous install of goreleaser v 0.160.0 was being done with curl command to https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh, but there have been changes to that script that broke bootstrap. Copied the shell script to repo and changed the checksum file name to goreleaser_checksums.txt

Signed-off-by: Zane Burstein <zane.burstein@anchore.com>
2021-09-07 14:20:13 -07:00