Commit graph

66 commits

Author SHA1 Message Date
Alex Goodman
cc8e7836f3
Add platform selection (#666) 2022-03-15 13:13:05 +00:00
Alex Goodman
1368ea05cd
Add additional DB archive decompressors (#657) 2022-03-07 11:44:43 -05:00
Keith Zantow
fc8e13f5b8
Support for SBOMs with incomplete linux distribution or CPE information (#606) 2022-03-03 16:31:46 -05:00
Alex Goodman
ad9918a681
Add gosimports linter (#647) 2022-03-03 14:50:24 -05:00
Alex Goodman
5aa85338d6
Normalize release assets and refactor install.sh (#630)
* refactor release to keep snapshot assets in parity with release assets

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

* refactor install.sh and put under test

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

* tidy go.sum

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

* add mac acceptance test to github actions workflow

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

* rm use of goreleaser in cli tests

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

* go mod tidy with go 1.17

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2022-02-11 19:24:25 +00:00
Alex Goodman
2f8682b3db
Add ability to merge matches (#602)
* enable merging of matches

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

* add ability for matches constructor to take initial matches

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

* update tests to include IDs on package objects

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

* rename common matcher helper package to search package

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

* rename search functions and add SearchByCriteria

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

* cleanup imports

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2022-01-25 10:29:16 -05:00
Alex Goodman
2647cd0d9e
Port grype-db to grype (#587)
* port grype-db to grype

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

* migrate vulnerability provider implementation to db package

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

* upgrade path import validations

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

* fix linting issues

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2022-01-12 10:03:22 -05:00
Alex Goodman
c88ee0e8f5
add expose minimal search configuration (#579)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2022-01-09 06:14:57 -05:00
Keith Zantow
647d6fb770
Add --exclude flag (#551) 2021-12-21 12:52:07 -05:00
Eng Zer Jun
0781fb028b
refactor: move from io/ioutil to io and os packages (#543)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-12-15 09:35:04 -05:00
Alex Goodman
51e1b6307b
Update syft, jotframe, and validations pipeline (#512)
* update syft and jotframe

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

* update validations and release pipeline

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

* moved terminal package to golang.org/x/term

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

* update integration tests to account for package relationships

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

* add license exception for xz

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

* update Location and Coordinate references

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

* remove benchmark tests

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

* remove mac acceptance tests

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

* add syft-grype relationship notes in DEVELOPING.md

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-11-30 18:10:07 +00:00
Dan Luhring
70ec3bfb71
Support for private certificate authorities during DB curation (#494)
* Add injectable HTTP client to file getter

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

* WIP: Map config for custom CA certs

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

* update curator and add tests

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

* add TLS helper scripts

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

* remove grype-db local mod edit

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

* tidy go modules

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

* use ssl.context over deprecated fn

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

* disallow tls 1 and 1.1

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

* suppress non-archive sources for fetch-to-dir capability

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

* ensure DB load failure does not panic

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

* address review comments

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

Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
2021-11-22 16:59:38 +00: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
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
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
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
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
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
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
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
Alex Goodman
bef03f70b3
Bump untar file size threshold (#392)
* bump untar file size threshold

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

* adjust variable names and comments around copyWithLimits for tar processing

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-08-23 09:16:35 -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
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
80fccec6f8
remove tar test testify comment
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-15 15:39:26 -04:00
Alex Goodman
34fa1cf0c8
adjust zip slip attack error message
Co-authored-by: Alfredo Deza <adeza@anchore.com>

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
2021-04-15 08:53:57 -04:00
Alex Goodman
a958acc57b
safely join paths derived from tar headers
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-15 08:53:57 -04:00
Alex Goodman
007542a1d1
dont append registry auth if potentially empty
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-14 09:21:04 -04:00
Alex Goodman
157640129e
add registry options to application configuration
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-13 16:09:38 -04:00
Dan Luhring
d4c3fa5f3b
Add tests for template presenter and consolidate data generation code
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-04-09 09:34:58 -04:00
Dan Luhring
eb74835a1a
Add template presenter
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2021-04-09 09:34:58 -04:00
Alex Goodman
07f61c0ff5
stage db by dir named by schema version
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-04-01 16:11:58 -04: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
Alex Goodman
0a9408005f
refactor constraint expression parser to allow for quoted versions
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2021-02-16 09:15:17 -05:00
Alex Goodman
45d3938046
do not require hashing of the DB file as validation on standard startup
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-12-14 07:55:55 -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
7fdbcf8a6c
add warn log level
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-11-12 10:02:40 -05:00
Alex Goodman
98a17355c5
remove constraint panics & invalid test assertiona (handle pre-release TODOs) (#171)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-09-29 10:20:51 -04:00
Alex Goodman
f0f8f4bf02
add --fail-on threshold support (#156)
* add --fail-on threshold support

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

* rename fail-on support functions and variables

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

* remove UK spelling of canceled

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-09-21 17:12:21 -04:00
Samuel Dacanay
9fa5064107 Fix json keys to be camel case instead of kebab
Signed-off-by: Samuel Dacanay <sam.dacanay@anchore.com>
2020-09-14 13:47:30 -07:00
Alex Goodman
651751f698
simplify version cmd + add json option (#139)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-08-25 11:51:24 -04:00
Dan Luhring
219d8bcf0f
Use warn instead of error for packages with no matchers (#113)
* Add warn method to logging system

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

* Move from error to warn for no matcher scenario

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
2020-08-10 16:03:12 -04:00
Alex Goodman
fb8f3d87ed
restore log source after etui exit 2020-08-02 18:31:00 -04:00
Alex Goodman
11731fac40
replace zap logger with logrus (#80) 2020-08-01 11:58:10 -04:00
Alex Goodman
6395481e73
Add ETUI (#77)
* add base syft UI elements

* add etui with shared ui elements

* allow for concurrent download DB and fetch/catalog image
2020-07-30 19:06:27 -04:00
Alex Goodman
009dcb1a46
Ignore prerelease versions on release + add DB update URL (#76)
* ignore prerelease versions when uploading version file on release

* add db update url
2020-07-30 12:37:49 -04:00
Alex Goodman
8d84dfeb65
finalize update check URL 2020-07-27 15:13:10 -04:00
Alex Goodman
5051c6202d
simplify schema checks and update grype-db 2020-07-25 19:03:33 -04:00
Alex Goodman
564fffec6d
rename to grype 2020-07-23 21:29:05 -04:00