Commit graph

56 commits

Author SHA1 Message Date
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
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
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
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
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 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
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
Alex Goodman
423a7c6d2f
add integration test for MSRC matching (#403)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-09-02 09:30:22 -04:00
Keith Zantow
7b044b1154
Add option to enable http registry connections #334 (#380)
Signed-off-by: Keith Zantow <kzantow@gmail.com>
2021-08-17 12:52:08 -04:00
Alex Goodman
b9a4eaaed5
narrow schema validation exception handling
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-07-20 13:32:06 -04:00
Alex Goodman
c7f33a8e4f
bump grype-db version to use main branch
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-07-20 12:18:29 -04:00
Alex Goodman
2d17d8fc41
update inline comparison script to ignore epoch
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-06-16 10:04:11 -04:00
Alex Goodman
9c63cfdcf4
remove v3 staging db references from test config
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-06-01 16:56:25 -04:00
Alex Goodman
13e647d670
rename matchDetails.matchedOn to matchDetails.found
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-06-01 15:19:47 -04:00
Alex Goodman
ed054f2038
incorporate multiple match details to accomodate more accurate reported CPE matching info
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-05-30 11:51:14 -04:00
Alex Goodman
6db86bfea8
rename SearchKey variable to SearchedBy
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-05-27 16:05:12 -04:00
Alex Goodman
d8aedf8117 use test config for schema validations
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-05-26 12:30:21 -04:00
Alex Goodman
f99da01100 add staging update-url to cli tests + add pre-release check
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-05-26 12:30:21 -04:00
Dan Luhring
8da410c578
Allow registry auth config without authority value (#322)
* Allow registry auth config without authority value

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

* Update CLI tests for new stereoscope log output

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-05-24 16:06:09 -04:00
Alex Goodman
2ecf5a58f0
remove upper limit to alpine-vuln inline-compare testing
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-05-07 14:59:35 -04:00
Alex Goodman
ce0bc73ede
adjust alpine matching to be able to independenly rely on nvd
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-05-07 13:57:34 -04:00
Alfredo Deza
878e312de1 remove msrc fromo defined matchers - can't use a container to catalog
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2021-05-03 14:56:00 -04:00
Alex Goodman
269d93cd57
update db status and add to json descriptor block
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-28 10:12:12 -04:00
Alex Goodman
9cd49d4c51
add registry cli tests + organize common utils
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-13 16:12:02 -04:00
Alex Goodman
55576feeb7
update integration tests with registry options
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-13 16:11:22 -04:00
Alex Goodman
a000a69b84
ensure compare script cannot divide by 0 and skips when inline finds nothing (#275)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-01 21:37:41 +00:00
Alex Goodman
976e3d68eb
pull in syft v0.14.0 and further decouple presenters from syft
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-01 10:01:07 -04:00
Dan Luhring
49b04f13eb
Add basic CLI tests for SBOM input
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-03-09 08:58:01 -05:00
Alfredo Deza
38e3405f0e remove schema-validation checks
No longer required since it is always going to be one schema imported as
part of `db`

Signed-off-by: Alfredo Deza <adeza@anchore.com>
2021-03-05 09:46:24 -05:00
Alfredo Deza
95acf0e0c9 refactor v1-based imports to db
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2021-03-05 09:32:13 -05:00
Alex Goodman
137be60f28
add grype pkg.Package adapter for syft pkg.Package and remove pkg.Catalog
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-12-14 07:55:54 -05:00
Alex Goodman
25d6ec6c79
add SBOM JSON document input from syft
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-11-17 17:55:24 -05:00
Alex Goodman
4ed516e784
bump syft to v0.7.1 (with related fixes)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-11-12 10:02:40 -05:00
Alex Goodman
2dcb017295
update python and javascript catalogers
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-10-23 11:34:18 -04:00
Alex Goodman
da614aa4ac
bump syft version (add package.json, rename bundler to ruby)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-10-19 08:02:13 -04:00
Alex Goodman
9d06b57a0e
incorporate gemspec cataloger (#177)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-10-09 11:09:42 -04:00
Alex Goodman
326afa3c41
Add OCI support + use URI schemes (#160)
* add oci support + update image schemes

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

* update to oci-dir

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

* bump upstream stereoscope, testutils, and syft pins

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

* fix malformed go.sum

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

* pull in upstream syft json presenter updates

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-09-25 14:18:03 -04:00
Alex Goodman
9f6301bbc2
Change root of JSON presenter to a mapping (instead of a sequence) (#163)
* update root of json presenter document

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

* change vulnerabilities to matches in json output

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-09-25 14:06:28 -04:00
Alex Goodman
ca8ac613e0
Rename Result object to Matches (#153)
* rename result to matches

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

* renames NewResult to NewMatches

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-09-17 06:02:17 -04:00
Alex Goodman
bd50ffc585
Change search key json output to a map (#146)
* change search key json output to a map

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

* add documentation around the match object

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-09-08 11:23:29 -04:00
Alfredo Deza
89f8ac49b9 test: update integration to match new SearchMatches
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2020-08-25 11:53:23 -04:00
Alfredo Deza
b0c6dc2fb1 test: update scope.FilesByGlob, it is now part of Resolver
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2020-08-18 11:31:07 -04:00
Alfredo Deza
41147df494 test: update integration validation for python packages with Python format
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2020-08-12 13:55:41 -04:00
Alex Goodman
56b9576a19
Add inline-comparison as acceptance test (#106)
* add inline-compare as acceptance tests

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

* improve RPM matching with source indirection matching

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

* add comments to compare-* make targets

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

* clean inline-compare image test names

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

* bump syft version to get rpm field enhancements

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-08-10 11:03:48 -04:00
Alfredo Deza
d8da43b410 test: update integration tests for alpine
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2020-08-07 09:44:40 -04:00
Alex Goodman
4476fc9888 broaden cpe matcher + modify alpine matcher
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2020-08-06 16:17:17 -04:00
Alfredo Deza
a9bf268abc integration tests for corner case
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2020-08-06 15:58:42 -04:00
Alfredo Deza
e0db0c1145 test: add integration corner cases for Alpine
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2020-08-06 15:58:42 -04:00
Dan Luhring
2cd127b932
Update pkg type (#87)
* Integrate Alex's changes

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

* Fix test issues

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

* Update syft dependency references

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2020-08-05 08:18:24 -04:00