Compare commits

..

124 Commits

Author SHA1 Message Date
Teppei Fukuda
3cb713c5d7 chore(readme): update (#266)
* chore(readme): update

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README
2019-11-14 17:26:36 +02:00
Teppei Fukuda
0106939d30 fix(skip-update): prohibit --skip-update in some situations (#262)
* fix(skip-update): prohibit --skip-update in some situations

* test(db): add some cases
2019-11-14 16:19:00 +02:00
Francois-Guillaume Ribreau
e371747bae doc(README): fix missing Gitlab CI link section in ToC (#263)
* doc(README): fix missing Gitlab CI link section in ToC

* Update README.md

Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-11-14 16:10:15 +02:00
Teppei Fukuda
514137ecd5 Merge pull request #253 from aquasecurity/remote_db
feat(db): use pre-built database
2019-11-13 17:43:15 +02:00
knqyf263
4f4019b920 fix(scanner/library): initialize vulnsrc 2019-11-13 17:15:28 +02:00
knqyf263
30fe97339b fix(options): display an warning about deprecated options instead of removing them 2019-11-12 22:25:36 +02:00
knqyf263
c91eb92d7f fix(github): remove authentication 2019-11-12 22:23:36 +02:00
knqyf263
fdeaaee53d test(integration): update vulnerability database 2019-11-12 22:02:56 +02:00
knqyf263
0cf1b70947 test(writer): fix the test for JsonWriter 2019-11-12 22:00:06 +02:00
knqyf263
6a9f4fdce0 chore(option): update the description for light mode 2019-11-12 21:55:44 +02:00
knqyf263
852c47f677 chore(module): update a dependency 2019-11-12 21:52:49 +02:00
knqyf263
8be4af33ee fix(redhat): format fixed versions 2019-11-12 21:44:51 +02:00
knqyf263
daf0d59461 test(integration): update amazon linux results
- Some vulnerabilities were updated
2019-11-12 21:43:58 +02:00
knqyf263
348f2bdde3 test(integration): update distroless results
- Some vulnerabilities were update
- Some vulnerabilities were rejected
- The order was changed
2019-11-12 21:42:15 +02:00
knqyf263
12b18ea7f4 test(integration): update ubi results
- Some vulnerabilities were updated
- Omit empty JSON keys
2019-11-12 21:37:29 +02:00
knqyf263
381b80125a test(integration): update centos results
- Some vulnerabilities were updated
- The statuses of some vulnerabilities were changed from affected to
unaffected
- Use OVAL
- Omit empty JSON keys
2019-11-12 21:35:08 +02:00
knqyf263
739b1f33e4 test(integration): update ubuntu results
- Some vulnerabilities were updated
- Omit empty JSON keys
2019-11-12 20:44:32 +02:00
knqyf263
d312c0d6b3 test(integration): update debian results
- Some new vulnerabilities were found
- Some vulnerabilities were rejected
- Some vulnerabilities were updated
- Omit empty JSON keys
2019-11-12 20:38:49 +02:00
knqyf263
61ec338ea8 test(integration): fix alpine 3.9 result
02764f1bda
2019-11-12 20:32:17 +02:00
knqyf263
b6cfbad35b test(integration): fix alpine results
A vulnerability information was updated.
6bf646bbc7
2019-11-12 20:25:49 +02:00
knqyf263
41589d5110 chore(gitignore): ignore fixtures 2019-11-12 20:25:39 +02:00
knqyf263
4fcd61c6b1 fix(writer): change the function name from Write to WriteResults 2019-11-10 16:58:07 +02:00
knqyf263
c96ecaae4a fix(github): use GetName 2019-11-10 16:48:50 +02:00
knqyf263
d1f35ffb59 fix(github): use GetPublishedAt 2019-11-10 16:47:39 +02:00
knqyf263
b348dc2b55 test(db): change getMetadata from an slice to an object 2019-11-10 16:40:45 +02:00
knqyf263
119e3098db fix(vulnerability): use warn instead of debug 2019-11-10 16:31:52 +02:00
knqyf263
4bf0615579 test(vulnerability): format 2019-11-10 16:16:37 +02:00
knqyf263
93c7b5e248 test(github): use require 2019-11-10 15:50:23 +02:00
knqyf263
51eb0dd362 Merge branch 'remote_db' of ssh://github.com/aquasecurity/trivy into remote_db 2019-11-10 15:46:11 +02:00
Simarpreet Singh
6a283102f9 writer_test: Test exported Write method for template types
Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-11-06 12:44:49 -08:00
Simarpreet Singh
8a5887a4d5 writer_test: Add exported Write testing for table full and light
Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-11-06 12:39:14 -08:00
Simarpreet Singh
b605bb4c53 writer_test: Test using exported method Write()
Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-11-06 12:30:24 -08:00
Simarpreet Singh
23b26e0b48 db_test: Add a happy path for first time run
Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-11-06 11:24:12 -08:00
knqyf263
9efc4214b2 test(db): use require instead of assert 2019-11-06 18:19:13 +02:00
knqyf263
84b759d767 test(db): fix an interface 2019-11-06 18:18:49 +02:00
knqyf263
abac635737 test(db): use require instead of panic 2019-11-06 18:14:50 +02:00
knqyf263
f0ea4be2e0 refactor(db): fix an info message 2019-11-06 18:06:41 +02:00
knqyf263
010a6867f3 refactor(db): add a debug message when skipping DB udpate 2019-11-06 18:04:07 +02:00
knqyf263
ee0d6b1841 refactor(db): initialize Metadata to suppress a warning 2019-11-06 18:01:42 +02:00
knqyf263
0604e363f4 refactor(log): show actual and expected DB version 2019-11-06 17:53:05 +02:00
knqyf263
77d7177627 refactor(log): show CLI version with the error 2019-11-06 17:44:24 +02:00
knqyf263
c44af99c6b Merge branch 'master' into remote_db 2019-11-06 17:18:51 +02:00
Teppei Fukuda
4f92d2942a chore(makefile): add Makefile (#256)
* chore(makefile): add Makefile

* chore(ci): use make

* chore(makefile): add clean

* chore(makefile): fix test commands

* chore(ci): split tests into the unit test and the integration test
2019-11-06 16:46:59 +02:00
knqyf263
6013ed9fd7 Merge branch 'master' into remote_db 2019-11-05 09:25:54 +02:00
Thomas Boerger
8ea2e8c632 Add env variables for every flag (#220)
I have added a mapping to a specific environment variable for every
currently available flag, I have followed the convention to simply
replace dashes within the flag name by an underscore.

There is no further configuration or change required as urfave/cli is
handling all of that for us.

Signed-off-by: Thomas Boerger <thomas@webhippie.de>
2019-11-03 10:38:49 +02:00
S Dhanya Abhirami
d1615bcdb6 typo fixed and GitHub Profile link added (#236)
* added author repo link

* typo fixes
2019-11-03 09:57:47 +02:00
Alenros
76d920eda7 Grammar (#232) 2019-11-02 21:04:56 +02:00
knqyf263
35a7d9bb15 chore(module): update dependencies 2019-11-01 22:19:54 +02:00
knqyf263
8257e0d455 test(vulnerability): fix test 2019-11-01 22:09:40 +02:00
knqyf263
d47958b7c5 test(bundler_scanner): fix test 2019-11-01 22:08:55 +02:00
knqyf263
380de9fd10 test(writer): fix test 2019-11-01 22:08:33 +02:00
knqyf263
ff4405589d test(integration): add tag 2019-11-01 22:07:52 +02:00
Liz Rice
1f072205a9 docs: typo correction (#252)
CLA-assistant wasn't able to correctly assess my contribution when I made a trivial correction to #250 so it's quicker just to create another PR
2019-11-01 20:32:44 +02:00
Liz Rice
c970018fc7 Merge pull request #190 from NinjaCoderDev/master
Fixed some typos in readme.md
2019-11-01 12:11:47 +00:00
Soumyadeep Sinha
5a3ebc1ba9 Merge branch 'master' into master 2019-11-01 11:52:26 +05:30
knqyf263
a97bbb0f8d feat(option): remove some options 2019-10-31 23:54:14 +02:00
knqyf263
46c7ff7a83 test(db): add tests 2019-10-31 23:53:46 +02:00
Greg Jacobs
f326beb1f2 Fixed broken link and some typos in Readme.md (#228)
* Fixing broken link and grammar in Readme.md

* Avoiding conflicts
2019-10-31 21:53:24 +02:00
knqyf263
55d5c29f38 feat(db): download a db file from GitHub Release 2019-10-31 12:26:02 +02:00
knqyf263
47273ef6da feat(library_scanner): use trivy-db 2019-10-31 12:26:02 +02:00
knqyf263
e5fc57af0e refactor(ospkg_scanner): use trivy-db 2019-10-31 12:26:02 +02:00
knqyf263
2921c25c62 refactor(vulnsrc): transfer code to trivy-db 2019-10-31 12:26:02 +02:00
inductor
e04e90fcbc add new line at eof (#249) 2019-10-31 10:42:10 +02:00
Miguel Bernabeu Diaz
d27eeb2b84 Add option to only download vulnerability database (#172)
* Add flag to download vulnerability database

When the `--download-db-only` flag is supplied, we will just download
the vulnerability database and exit without performing any scans.

If a database had been downloaded before the present run, and
`--only-update` option has been specified, we will only update the
database for the selected distribution and exit.

* Add documentation for `--download-db-only` flag

Add section to README on usage limitations of the new flag.
2019-10-30 17:46:50 +02:00
Manuel Rüger
62ea073bad Enable shell autocompletion (#234)
This allows to enable autocompletion via

https://github.com/urfave/cli/blob/master/docs/v1/manual.md#bash-completion
2019-10-29 10:56:00 +02:00
Bryant Hagadorn
187864a4e4 Added GitLab YML (#223) 2019-10-28 11:03:42 +02:00
James Ward
a666c4a787 massage rubygems version to handle platforms (#230)
the rubygems version includes "platform" within the version
and it gets pulled into version.Version as a pre-release
value.

this means that in the case of something like "ffi",
1.9.25-java is not counted correctly as matching
">= 1.9.25".
2019-10-28 10:53:33 +02:00
James Ward
bda4ee0ad5 add echo to CI gofmt step (#231)
the CI step that runs gofmt doesn't echo out a string
so it causes the step to fail before emitting the "gofmt"
errors that need to be fixed
2019-10-28 10:44:26 +02:00
Soumyadeep Sinha
4925873a67 Merge branch 'master' into master 2019-10-24 17:50:48 +05:30
Vipul Chodankar
63ed4eb77f Fixed Broken README links (#214)
* Fixed Broken README links

* Reverted link change in migration sectioN
2019-10-24 14:07:00 +03:00
Teppei Fukuda
d03a64ced0 Update README (#224)
* Update README

* Add Distroless
2019-10-23 18:23:06 +03:00
Soumyadeep Sinha
615a56353d Merge branch 'master' into master 2019-10-23 20:19:15 +05:30
Soumyadeep Sinha
45db6df1eb Update README.md
Co-Authored-By: Liz Rice <liz@lizrice.com>
2019-10-23 20:17:32 +05:30
Soumyadeep Sinha
ac628f39ec Update README.md
Co-Authored-By: Liz Rice <liz@lizrice.com>
2019-10-23 20:17:23 +05:30
Teppei Fukuda
20babc46a1 Bump Go 1.13 (#218) 2019-10-23 17:00:03 +03:00
Itay Shakury
a6141ed2f0 CI/CD refactor (#209)
* ci refactor, goreleaser upgrade and push to docker

* formatting

Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>

* add latest docker tag
2019-10-23 16:12:07 +03:00
Teppei Fukuda
a12bb8d0e2 fix(db): introduce db schema version (#221) 2019-10-23 16:00:04 +03:00
Manuel Rüger
5ae10e0463 Dockerfile: Update runner base to alpine 3.10 (#199)
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2019-10-22 11:35:05 +03:00
Teppei Fukuda
ff873a274b Support Amazon Linux (#182)
* Support Amazon Linux

* amazon: Add tests for Scanner Detect functionality

* amazon: Add more test cases for unhappy paths.

This commit also asserts the logged output via observer.

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon: Add a test case for invalid fixed pkg version

Signed-off-by: Simarpreet Singh <simar@linux.com>

* mod: go mod tidy

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon: Inject dependency seams for exposed db interface and logger.

This commit also exposes an interface for doing db operations.

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon: Use injected logger for scanner.

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon_test: Add a sample testdata dir

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon: Add tests for for Get() for amazon vulns.

Signed-off-by: Simarpreet Singh <simar@linux.com>

* vulnsrc_test: Fix invocation call to SetVersion()

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon_test: Add a test for severirtyFromPriority

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon_test: Add tests for constructVersion()

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon: Refactor walkFunc outside for testability purposes

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon: Refactor walkFn and add tests for it.

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon: Refactor commitFunc closure and add tests

This commit also introduces an interface for the
vulnerability package to be used as a seam.

Signed-off-by: Simarpreet Singh <simar@linux.com>

* Revert "amazon: Use injected logger for scanner."

This reverts commit 5a81e4d824a95f4de4aae2e2b903eedd0f7e241f.

* test(amazon): fix failed tests

* fix(vulnerability): trim references

* test(amazon): add integration test
2019-10-22 09:31:15 +03:00
Sidhya Tikku
7ad94c34e7 Update .gitignore (#215) 2019-10-20 12:11:02 +03:00
Teppei Fukuda
f8509846cf test(integration): add integration tests (#201)
* divide into NewApp function

* sort scan results for idempotency

* chore(integration): add integration tests

* tar_input_test: strengthen assertions

Signed-off-by: Simarpreet Singh <simar@linux.com>

* writer_test: Add a happy path for TestReportWriter

Signed-off-by: Simarpreet Singh <simar@linux.com>

* writer_test: switch to table test cases

Signed-off-by: Simarpreet Singh <simar@linux.com>

* writer_test: Add more scenarios for TestReportWriter_Table

Signed-off-by: Simarpreet Singh <simar@linux.com>

* writer: Change back to []Results and add happy path for JSON writer

Signed-off-by: Simarpreet Singh <simar@linux.com>

* writer_test: Switch to a table driven format

Signed-off-by: Simarpreet Singh <simar@linux.com>

* writer_test: cleanup

Signed-off-by: Simarpreet Singh <simar@linux.com>

* scan: Go back to report.Result by value

Signed-off-by: Simarpreet Singh <simar@linux.com>

* Revert "scan: Go back to report.Result by value"

This reverts commit 03b6f7abd7d0d22d87c825d0ef3759cca200b9fc.

* switch back to by value for results

Signed-off-by: Simarpreet Singh <simar@linux.com>

* writer_test: document a behavior with template inputs

Signed-off-by: Simarpreet Singh <simar@linux.com>

* vulnerability: Add a failing test to show unexpected sorting behavior.

Signed-off-by: Simarpreet Singh <simar@linux.com>

* report: Simplify []*Result to []Result.

Signed-off-by: Simarpreet Singh <simar@linux.com>

* test(template): add happy path

* test(vulnerability): fix expected values

* tar_input_test: Move gunzipDB

Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-10-18 13:58:27 -07:00
Snow-HardWolf
9334e607a0 Changed to be able to specify IgnoreFile as whitelist (#175)
* Add : add option flag to specify ignorefile

* Add : reading flag and pass variable to function

* Add : reading specific ignorefile as trivyIgnore

* Remove extra ignoreFile check from vulnerability.go

Remove check if ignoreFile is empty

Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>

* Fix : remove completely ignoreFile check

* Refactor : run gofmt to main.go
2019-10-17 10:40:57 +03:00
Sebastian Ehmann
f198b6eb63 Check errors passed through by filepath.Walk (#208)
In several files, the error passed from filepath.Walk to WalkFunc is
not checked. As the info argument to WalkFn is nil in case of an error,
accessing info can cause a runtime panic.
This commit adds checks for errors passed through to WalkFunc.
2019-10-17 10:34:19 +03:00
Aayush Srivastava
cb1870e7bf Update README.md (#206)
Added and elaborated the correct license details(with the link to the license page) and improved the readability of the README file.
2019-10-17 10:25:21 +03:00
Sebastian Ehmann
384205a8c5 Remove extra double quote (#204) 2019-10-17 10:17:32 +03:00
kapil Israni
d9e64d2cfe Updated README.md (#203)
Added the definition of the term 'Vulnerability' for beginners along with a minor grammatical correction.
2019-10-17 10:11:44 +03:00
Sumit Kharche
5ccb0af867 Added Docker image badge & missing punctuation's (#189)
* Added Docker image badge & missing punctuation's

* Removed extra line
2019-10-15 09:30:41 +03:00
Masahiro Fujimura
da621c3524 Add timeout option (#143)
* Add timeout

* Fix cli.IntFlag -> cli.DurationFlag
2019-10-15 08:58:03 +03:00
Nikita Titov
3a28576e02 added reference for LICENSE (#195) 2019-10-15 08:49:30 +03:00
Sebastian Ehmann
dbb7a555ce Check returned error before deferring file close (#197) 2019-10-15 08:41:57 +03:00
NinjaCoderDev
7a6991c8d9 Fixed typo 2019-10-12 23:37:15 +05:30
NinjaCoderDev
6efac16c80 Fixed some typos 2019-10-12 23:33:05 +05:30
Itay Shakury
a7360a4b34 add contribution guideline
Merge pull request #185 from itaysk/master
2019-10-12 17:43:20 +03:00
Teppei Fukuda
4fb9f0cb74 Merge branch 'master' into master 2019-10-12 11:56:51 +03:00
James George
89f2d48f0f docs: minor tweak (#183) 2019-10-11 22:02:12 +03:00
Itay Shakury
11dcbff707 typo
Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-10-11 21:00:31 +03:00
Itay Shakury
7a6074721f typo
Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-10-11 21:00:14 +03:00
Itay Shakury
959e43d8f9 typo
Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-10-11 21:00:02 +03:00
Mohamed El Sayed
f933ab4602 Improve ubuntu install (#178)
* Improve ubuntu install

* Add `lsb-release` to install command

Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-10-11 00:20:40 +03:00
Parikshit Hooda
af78d2fd69 Update README.md - typo fix (#186)
Typo fix.
Change 'occured' to 'occurred'.
2019-10-11 00:08:41 +03:00
Itay Shakury
6f9c4aa2e0 remove contributing section from readme 2019-10-10 13:45:17 +03:00
Itay Shakury
5efa4a4751 add CONTRIBUTING.md 2019-10-10 13:44:42 +03:00
Liz Rice
cde336ec99 Merge pull request #177 from aquasecurity/rpm-dependency
docs: add more detail on rpm dependency to README
2019-10-03 13:43:44 +02:00
Liz Rice
b8c51c56c2 docs: add more detail on rpm dependency to README 2019-10-03 12:30:56 +01:00
Liz Rice
22c28adc78 Merge pull request #174 from aquasecurity/remove_transfer
Remove the text about transfer and migration
2019-10-02 09:53:00 +02:00
knqyf263
7b04f31566 Remove the text about transfer and migration 2019-10-02 09:20:41 +03:00
Teppei Fukuda
0fff415c2a Support Kaniko (#171) 2019-10-02 08:49:30 +03:00
Teppei Fukuda
987538fc49 Display an error message when rpm not found (#167) 2019-09-26 14:31:15 +03:00
Teppei Fukuda
2642020398 Support distroless and ignore lock files under vendor dir (#166) 2019-09-25 16:40:24 +03:00
Teppei Fukuda
c4a2b762e7 Add rpm to the trivy image (#165) 2019-09-25 14:19:43 +03:00
Stephen Paulger
339d0db240 Add template writer (#141) 2019-09-25 09:37:16 +03:00
Teppei Fukuda
43568ccd69 Update xerrors version (#158) 2019-09-24 21:26:22 +03:00
homoluctus
fbd73f2f17 Modify cache-dir usage comment (#148) 2019-09-20 10:29:07 +03:00
inductor
4a21ad9540 env (#154) 2019-09-19 13:12:50 +03:00
ress
18de7e45e9 README.md is out of date (#145) 2019-09-05 00:02:48 +09:00
Liz Rice
48f66aa3fe Merge pull request #142 from carehart/patch-1
Tweaked some wording for clarity
2019-09-02 16:52:47 +01:00
Charlie Arehart
18274462ff Tweaked some wording for clarity 2019-08-31 15:41:08 -05:00
Teppei Fukuda
90e4c159b1 Add the RHEL8 support to rpm repository (#138)
* Add the RHEL8 support

* Use variable
2019-08-30 21:09:28 +09:00
inductor
4f57216935 use COPY on dockerfile rather than add (#132) 2019-08-24 19:03:00 -10:00
Laurent Commarieu
e6b68305ec fix typo in readme (#130) 2019-08-24 18:16:22 -10:00
inductor
4ce651c0e4 fix gofmt (#131)
* fix gofmt

* add gofmt check script
2019-08-24 18:10:13 -10:00
Liz Rice
db2d4e45eb Merge pull request #128 from aquasecurity/fix/readme
Fix README
2019-08-23 15:22:55 +01:00
knqyf263
876b8bd795 Update 2019-08-22 16:46:39 -10:00
knqyf263
64ef6b63b7 Fix README 2019-08-22 16:19:03 -10:00
93 changed files with 50470 additions and 3132 deletions

View File

@@ -1,6 +1,6 @@
defaults: &defaults
docker :
- image: knqyf263/ci-trivy:latest
- image: aquasec/trivy-ci:latest
environment:
CGO_ENABLED: "0"
@@ -9,13 +9,31 @@ jobs:
<<: *defaults
steps:
- checkout
- run:
name: Check if there's anything to fix with gofmt
command: |
if test -z "$(gofmt -l .)"; then
echo "Congrats! There is nothing to fix."
else
echo "The following lines should be fixed."
gofmt -s -d .
exit 1
fi
- run:
name: Test
command: go test ./...
command: make test
- run:
name: Integration Test
command: make test-integration
release:
<<: *defaults
steps:
- checkout
- setup_remote_docker:
version: 18.06.0-ce
- run:
name: setup docker
command: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: Release
command: goreleaser --rm-dist

7
.gitignore vendored
View File

@@ -12,3 +12,10 @@
*.out
.idea
# Directory Cache Files
.DS_Store
thumbs.db
# test fixtures
integration/testdata/fixtures/

28
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,28 @@
Thank you for taking interest in contributing to Trivy !
## Issues
- Feel free to open issues for any reason. When you open a new issue, you'll have to select an issue kind: bug/feature/support and fill the required information based on the selected template.
- Please spend a small amount of time giving due diligence to the issue tracker. Your issue might be a duplicate. If it is, please add your comment to the existing issue.
- Remember users might be searching for your issue in the future, so please give it a meaningful title to help others.
- The issue should clearly explain the reason for opening, the proposal if you have any, and any relevant technical information.
## Pull Requests
1. Every Pull Request should have an associated bug or feature issue unless you are fixing a trivial documentation issue.
1. Your PR is more likely to be accepted if it focuses on just one change.
1. Describe what the PR does. There's no convention enforced, but please try to be concise and descriptive. Treat the PR description as a commit message. Titles that starts with "fix"/"add"/"improve"/"remove" are good examples.
1. Please add the associated Issue in the PR description.
1. There's no need to add or tag reviewers.
1. If a reviewer commented on your code or asked for changes, please remember to mark the discussion as resolved after you address it. PRs with unresolved issues should not be merged (even if the comment is unclear or requires no action from your side).
1. Please include a comment with the results before and after your change.
1. Your PR is more likely to be accepted if it includes tests (We have not historically been very strict about tests, but we would like to improve this!).
1. If your PR affects the user experience in some way, please update the Readme and the CLI help accordingly.
## Understand where your pull request belongs
Trivy is composed of several different repositories that work together:
- [Trivy](https://github.com/aquasecurity/trivy) is the client-side, user-facing, command line tool.
- [vuln-list](https://github.com/aquasecurity/vuln-list) is a vulnerabilities database, aggregated from different sources, and normalized for easy consumption. This of this as the "server" side of the trivy command line tool. **There should be no pull requests to this repo**
- [vuln-list-update](https://github.com/aquasecurity/vuln-list-update) is the code that maintains the vuln-list database.
- [fanal](https://github.com/aquasecurity/fanal) is a library for extracting system information containers. It is being used by Trivy to find testable subjects in the container image.

View File

@@ -1,15 +1,5 @@
FROM golang:1.12-alpine AS builder
ADD go.mod go.sum /app/
WORKDIR /app/
RUN apk --no-cache add git upx
RUN go mod download
ADD . /app/
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(git describe --tags --abbrev=0)" -a -o /trivy cmd/trivy/main.go
RUN upx --lzma --best /trivy
FROM alpine:3.9
RUN apk --no-cache add ca-certificates git
COPY --from=builder /trivy /usr/local/bin/trivy
RUN chmod +x /usr/local/bin/trivy
FROM alpine:3.10
RUN apk --no-cache add ca-certificates git rpm
COPY trivy /usr/local/bin/trivy
ENTRYPOINT ["trivy"]

42
Makefile Normal file
View File

@@ -0,0 +1,42 @@
VERSION := $(shell git describe --tags)
LDFLAGS=-ldflags "-s -w -X=main.version=$(VERSION)"
GOPATH=$(shell go env GOPATH)
GOBIN=$(GOPATH)/bin
u := $(if $(update),-u)
.PHONY: deps
deps:
go get ${u} -d
go mod tidy
$(GOBIN)/golangci-lint:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOBIN) v1.21.0
.PHONY: test
test:
go test -v -short ./...
integration/testdata/fixtures/*.tar.gz:
git clone https://github.com/aquasecurity/trivy-test-images.git integration/testdata/fixtures
.PHONY: test-integration
test-integration: integration/testdata/fixtures/*.tar.gz
go test -v -tags=integration ./integration/...
.PHONY: lint
lint: $(GOBIN)/golangci-lint
$(GOBIN)/golangci-lint run
.PHONY: build
build:
go build $(LDFLAGS) ./cmd/trivy
.PHONY: install
install:
go install $(LDFLAGS) ./cmd/trivy
.PHONY: clean
clean:
rm -rf integration/testdata/fixtures/

295
README.md
View File

@@ -1,23 +1,19 @@
**This repository was transferred from knqyf263/trivy to aquasecurity/trivy.**
**If you have previously installed Trivy, please check the [Migration](#Migration) section in case you have any scripts or package managers that need to be updated. We apologise for any inconvenience.**
<img src="imgs/logo.png" width="300">
[![GitHub release](https://img.shields.io/github/release/aquasecurity/trivy.svg)](https://github.com/aquasecurity/trivy/releases/latest)
[![CircleCI](https://circleci.com/gh/aquasecurity/trivy.svg?style=svg)](https://circleci.com/gh/aquasecurity/trivy)
[![Go Report Card](https://goreportcard.com/badge/github.com/aquasecurity/trivy)](https://goreportcard.com/report/github.com/aquasecurity/trivy)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://github.com/aquasecurity/trivy/blob/master/LICENSE)
[![Docker image](https://images.microbadger.com/badges/version/aquasec/trivy.svg)](https://microbadger.com/images/aquasec/trivy "Get your own version badge on microbadger.com")
A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable for CI
A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable for CI.
<img src="imgs/usage.gif" width="700">
<img src="imgs/usage1.png" width="600">
<img src="imgs/usage2.png" width="600">
# TOC
# Table of Contents
- [Abstract](#abstract)
- [Features](#features)
@@ -37,7 +33,7 @@ A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable for CI
- [Save the results as JSON](#save-the-results-as-json)
- [Filter the vulnerabilities by severities](#filter-the-vulnerabilities-by-severities)
- [Filter the vulnerabilities by type](#filter-the-vulnerabilities-by-type)
- [Skip an update of vulnerability DB](#skip-an-update-of-vulnerability-db)
- [Skip an update of vulnerability DB](#skip-update-of-vulnerability-db)
- [Ignore unfixed vulnerabilities](#ignore-unfixed-vulnerabilities)
- [Specify exit code](#specify-exit-code)
- [Ignore the specified vulnerabilities](#ignore-the-specified-vulnerabilities)
@@ -46,6 +42,7 @@ A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable for CI
- [Continuous Integration (CI)](#continuous-integration-ci)
- [Travis CI](#travis-ci)
- [CircleCI](#circleci)
- [GitLab CI](#gitlab)
- [Authorization for Private Docker Registry](#authorization-for-private-docker-registry)
- [Vulnerability Detection](#vulnerability-detection)
- [OS Packages](#os-packages)
@@ -64,8 +61,9 @@ A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable for CI
# Abstract
`Trivy` (`tri` pronounced like **tri**gger, `vy` pronounced like en**vy**) is a simple and comprehensive vulnerability scanner for containers.
A software vulnerability is a glitch, flaw, or weakness present in the software or in an Operating System.
`Trivy` detects vulnerabilities of OS packages (Alpine, RHEL, CentOS, etc.) and application dependencies (Bundler, Composer, npm, yarn etc.).
`Trivy` is easy to use. Just install the binary and you're ready to scan. All you need to do for scanning is to specify an image name of container.
`Trivy` is easy to use. Just install the binary and you're ready to scan. All you need to do for scanning is to specify an image name of the container.
It is considered to be used in CI. Before pushing to a container registry, you can scan your local container image easily.
See [here](#continuous-integration-ci) for details.
@@ -73,14 +71,17 @@ See [here](#continuous-integration-ci) for details.
# Features
- Detect comprehensive vulnerabilities
- OS packages (Alpine, **Red Hat Universal Base Image**, Red Hat Enterprise Linux, CentOS, Debian and Ubuntu)
- OS packages (Alpine, **Red Hat Universal Base Image**, Red Hat Enterprise Linux, CentOS, Debian, Ubuntu, Amazon Linux and Distroless)
- **Application dependencies** (Bundler, Composer, Pipenv, Poetry, npm, yarn and Cargo)
- Simple
- Specify only an image name
- See [Quick Start](#quick-start) and [Examples](#examples)
- Fast
- The first scan will finish within 10 seconds (depending on your network). Consequent scans will finish in single seconds.
- Unlike other scanners that take long to fetch vulnerability information (~10 minutes) on the first run, and encourage you to maintain the a durable vulnerability database, Trivy is stateless and requires no maintenance or preparation.
- Easy installation
- **No need for prerequirements** such as installation of DB, libraries, etc.
- `apt-get install`, `yum install` and `brew install` is possible (See [Installation](#installation))
- **No pre-requisites** such as installation of DB, libraries, etc. (The exception is that you need `rpm` installed to scan images based on RHEL/CentOS. This is automatically included if you use our installers or the Trivy container image. See [Vulnerability Detection](#vulnerability-detection) for background information.)
- High accuracy
- **Especially Alpine Linux and RHEL/CentOS**
- Other OSes are also high
@@ -108,21 +109,17 @@ $ sudo yum -y install trivy
or
```
$ rpm -ivh https://github.com/aquasecurity/trivy/releases/download/v0.0.15/trivy_0.0.15_Linux-64bit.rpm
$ rpm -ivh https://github.com/aquasecurity/trivy/releases/download/v0.1.6/trivy_0.1.6_Linux-64bit.rpm
```
## Debian/Ubuntu
Replace `[CODE_NAME]` with your code name
CODE_NAME: wheezy, jessie, stretch, buster, trusty, xenial, bionic
`$ lsb_release -c`
Add repository to `/etc/apt/sources.list.d`.
```
$ sudo apt-get install apt-transport-https gnupg
$ sudo apt-get install wget apt-transport-https gnupg lsb-release
$ wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
$ echo deb https://aquasecurity.github.io/trivy-repo/deb [CODE_NAME] main | sudo tee -a /etc/apt/sources.list.d/trivy.list
$ echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
$ sudo apt-get update
$ sudo apt-get install trivy
```
@@ -131,11 +128,14 @@ or
```
$ sudo apt-get install rpm
$ wget https://github.com/aquasecurity/trivy/releases/download/v0.0.15/trivy_0.0.15_Linux-64bit.deb
$ sudo dpkg -i trivy_0.0.15_Linux-64bit.deb
$ wget https://github.com/aquasecurity/trivy/releases/download/v0.1.6/trivy_0.1.6_Linux-64bit.deb
$ sudo dpkg -i trivy_0.1.6_Linux-64bit.deb
```
## Arch Linux
trivy-bin can be installed from the Arch User Repository. Examples:
Package trivy-bin can be installed from the Arch User Repository. Examples:
```
pikaur -Sy trivy-bin
```
@@ -156,7 +156,7 @@ $ brew install aquasecurity/trivy/trivy
Get the latest version from [this page](https://github.com/aquasecurity/trivy/releases/latest), and download the archive file for your operating system/architecture. Unpack the archive, and put the binary somewhere in your `$PATH` (on UNIX-y systems, /usr/local/bin or the like). Make sure it has execution bits turned on.
You need to install `rpm` command for scanning RHEL/CentOS.
You also need to install `rpm` command for scanning images based on RHEL/CentOS.
## From source
@@ -169,9 +169,11 @@ $ export GO111MODULE=on
$ go install
```
You also need to install `rpm` command for scanning images based on RHEL/CentOS.
# Quick Start
Simply specify an image name (and a tag). **The `latest` tag should be avoided as problems occur with cache.**. See [Clear image caches](#clear-image-caches)
Simply specify an image name (and a tag). **The `latest` tag should be avoided as problems occur with the image cache.** See [Clear image caches](#clear-image-caches).
## Basic
@@ -227,7 +229,7 @@ $ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
-v $HOME/Library/Caches:/root/.cache/ aquasec/trivy python:3.4-alpine
```
Please re-pull latest `aquasecurity/trivy` if an error occured.
Please re-pull latest `aquasec/trivy` if an error occurred.
<details>
<summary>Result</summary>
@@ -257,7 +259,7 @@ Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
Simply specify an image name (and a tag).
```
$ trivy aquasecurity/test-image:1.2.3
$ trivy knqyf263/vuln-image:1.2.3
```
<details>
@@ -277,7 +279,7 @@ $ trivy aquasecurity/test-image:1.2.3
2019-05-16T12:59:10.285+0900 INFO Updating pipenv Security DB...
2019-05-16T12:59:11.487+0900 INFO Detecting pipenv vulnerabilities...
aquasecurity/test-image:1.2.3 (alpine 3.7.1)
knqyf263/vuln-image:1.2.3 (alpine 3.7.1)
========================================
Total: 26 (UNKNOWN: 0, LOW: 3, MEDIUM: 16, HIGH: 5, CRITICAL: 2)
@@ -720,12 +722,12 @@ Available values:
<summary>Result</summary>
```
2019-05-22T19:36:50.530+0200 INFO Updating vulnerability database...
2019-05-22T19:36:51.681+0200 INFO Detecting Alpine vulnerabilities...
2019-05-22T19:36:51.685+0200 INFO Updating npm Security DB...
2019-05-22T19:36:52.389+0200 INFO Detecting npm vulnerabilities...
2019-05-22T19:36:52.390+0200 INFO Updating pipenv Security DB...
2019-05-22T19:36:53.406+0200 INFO Detecting pipenv vulnerabilities...
2019-05-22T19:36:50.530+0200 INFO Updating vulnerability database...
2019-05-22T19:36:51.681+0200 INFO Detecting Alpine vulnerabilities...
2019-05-22T19:36:51.685+0200 INFO Updating npm Security DB...
2019-05-22T19:36:52.389+0200 INFO Detecting npm vulnerabilities...
2019-05-22T19:36:52.390+0200 INFO Updating pipenv Security DB...
2019-05-22T19:36:53.406+0200 INFO Detecting pipenv vulnerabilities...
ruby:2.3.0 (debian 8.4)
Total: 4751 (UNKNOWN: 1, LOW: 150, MEDIUM: 3504, HIGH: 1013, CRITICAL: 83)
@@ -842,9 +844,9 @@ Total: 4751 (UNKNOWN: 1, LOW: 150, MEDIUM: 3504, HIGH: 1013, CRITICAL: 83)
</details>
### Skip an update of vulnerability DB
### Skip update of vulnerability DB
`Trivy` always updates vulnerability database when it starts operating. This is usually fast as it is a difference update. But if you want to skip even that, use the `--skip-update` option.
`Trivy` always updates its vulnerability database when it starts operating. This is usually fast, as it is a difference update. But if you want to skip even that, use the `--skip-update` option.
```
$ trivy --skip-update python:3.4-alpine3.9
@@ -870,37 +872,16 @@ Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
</details>
### Update only you are specified distributions
By default, `Trivy` always updates vulnerability database of all distribution. Use the `--only-update` option if you want to update only specified distributions.
### Only download vulnerability database
You can also ask `Trivy` to simply retrieve the vulnerability database. This is useful to initialize workers in Continuous Integration systems. In the first run, the `--only-update` option is silently ignored.
```
$ trivy --only-update alpine,debian python:3.4-alpine3.9
$ trivy --only-update alpine python:3.4-alpine3.9
$ trivy --download-db-only
$ trivy --download-db-only --only-update alpine
```
<details>
<summary>Result</summary>
```
2019-05-21T19:37:06.301+0900 INFO Updating vulnerability database...
2019-05-21T19:37:07.793+0900 INFO Updating alpine data...
2019-05-21T19:37:08.127+0900 INFO Detecting Alpine vulnerabilities...
python:3.4-alpine3.9 (alpine 3.9.2)
===================================
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| openssl | CVE-2019-1543 | MEDIUM | 1.1.1a-r1 | 1.1.1b-r1 | openssl: ChaCha20-Poly1305 |
| | | | | | with long nonces |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
```
</details>
### Ignore unfixed vulnerabilities
By default, `Trivy` also detects unpatched/unfixed vulnerabilities. This means you can't fix these vulnerabilities even if you update all packages.
@@ -1071,11 +1052,53 @@ $ trivy --reset
</details>
### Use lightweight DB
The lightweight DB doesn't contain vulnerability detail such as descriptions and references. Because of that, the size of the DB is smaller and the download is faster.
This option is useful when you don't need vulnerability details and is suitable for CI/CD.
To find the additional information, you can search vulnerability details on the NVD website.
https://nvd.nist.gov/vuln/search
```
$ trivy --light alpine:3.10
```
`--light` option doesn't display titles like the following example.
<details>
<summary>Result</summary>
```
2019-11-14T10:21:01.553+0200 INFO Reopening vulnerability DB
2019-11-14T10:21:02.574+0200 INFO Detecting Alpine vulnerabilities...
alpine:3.10 (alpine 3.10.2)
===========================
Total: 3 (UNKNOWN: 0, LOW: 1, MEDIUM: 2, HIGH: 0, CRITICAL: 0)
+---------+------------------+----------+-------------------+---------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION |
+---------+------------------+----------+-------------------+---------------+
| openssl | CVE-2019-1549 | MEDIUM | 1.1.1c-r0 | 1.1.1d-r0 |
+ +------------------+ + + +
| | CVE-2019-1563 | | | |
+ +------------------+----------+ + +
| | CVE-2019-1547 | LOW | | |
+---------+------------------+----------+-------------------+---------------+
```
</details>
### Deprecated options
`--only-update`, `--refresh` and `--auto-refresh` are deprecated since they are unnecessary now. These options will be removed at the next version
# Continuous Integration (CI)
Scan your image built in Travis CI/CircleCI. The test will fail if a vulnerability is found. When you don't want to fail the test, specify `--exit-code 0` .
**Note**: It will take a while for the first time (faster by cache after the second time)
Since in automated scenarios such as CI/CD you only interested in the end result, and not the full report, use the `--light` flag to optimize for this scenario and get fast results.
## Travis CI
@@ -1094,8 +1117,8 @@ before_install:
- wget https://github.com/aquasecurity/trivy/releases/download/v${VERSION}/trivy_${VERSION}_Linux-64bit.tar.gz
- tar zxvf trivy_${VERSION}_Linux-64bit.tar.gz
script:
- ./trivy --exit-code 0 --severity HIGH --quiet --auto-refresh trivy-ci-test:${COMMIT}
- ./trivy --exit-code 1 --severity CRITICAL --quiet --auto-refresh trivy-ci-test:${COMMIT}
- ./trivy --exit-code 0 --severity HIGH --no-progress trivy-ci-test:${COMMIT}
- ./trivy --exit-code 1 --severity CRITICAL --no-progress trivy-ci-test:${COMMIT}
cache:
directories:
- $HOME/.cache/trivy
@@ -1114,9 +1137,6 @@ jobs:
- image: docker:18.09-git
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: vulnerability-db
- run:
name: Build image
command: docker build -t trivy-ci-test:${CIRCLE_SHA1} .
@@ -1135,11 +1155,7 @@ jobs:
mv trivy /usr/local/bin
- run:
name: Scan the local image with trivy
command: trivy --exit-code 0 --quiet --auto-refresh trivy-ci-test:${CIRCLE_SHA1}
- save_cache:
key: vulnerability-db
paths:
- $HOME/.cache/trivy
command: trivy --exit-code 0 --no-progress trivy-ci-test:${CIRCLE_SHA1}
workflows:
version: 2
release:
@@ -1150,9 +1166,37 @@ workflows:
Example: https://circleci.com/gh/aquasecurity/trivy-ci-test
Repository: https://github.com/aquasecurity/trivy-ci-test
## GitLab
```
$ cat .gitlab-ci.yml
stages:
- test
trivy:
stage: test
image: docker:stable-git
before_script:
- docker build -t trivy-ci-test:${CI_COMMIT_REF_NAME} .
- export VERSION=$(curl --silent "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
- wget https://github.com/aquasecurity/trivy/releases/download/v${VERSION}/trivy_${VERSION}_Linux-64bit.tar.gz
- tar zxvf trivy_${VERSION}_Linux-64bit.tar.gz
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- ./trivy --exit-code 0 --severity HIGH --no-progress trivy-ci-test:${CI_COMMIT_REF_NAME}
- ./trivy --exit-code 1 --severity CRITICAL --no-progress trivy-ci-test:${CI_COMMIT_REF_NAME}
cache:
directories:
- $HOME/.cache/trivy
```
## Authorization for Private Docker Registry
Trivy can download images from private registry, without installing `Docker` and any 3rd party tools.
Trivy can download images from a private registry, without installing `Docker` or any other 3rd party tools.
That's because it's easy to run in a CI process.
All you have to do is install `Trivy` and set ENV vars.
@@ -1208,8 +1252,14 @@ The unfixed/unfixable vulnerabilities mean that the patch has not yet been provi
| Red Hat Universal Base Image | 7, 8 | Installed by yum/rpm | YES |
| Red Hat Enterprise Linux | 6, 7, 8 | Installed by yum/rpm | YES |
| CentOS | 6, 7 | Installed by yum/rpm | YES |
| Amazon Linux | 1, 2 | Installed by apt/apt-get/dpkg | NO |
| Debian GNU/Linux | wheezy, jessie, stretch, buster | Installed by apt/apt-get/dpkg | YES |
| Ubuntu | 12.04, 14.04, 16.04, 18.04, 18.10, 19.04 | Installed by apt/apt-get/dpkg | YES |
| Distroless | Any | Installed by apt/apt-get/dpkg | YES |
RHEL, CentOS and Amazon Linux package information is stored in a binary format, and Trivy uses the `rpm` executable to parse this information when scanning an image based on RHEL or CentOS. The Trivy container image includes `rpm`, and the installers include it as a dependency. If you installed the `trivy` binary using `wget` or `curl`, or if you build it from source, you will also need to ensure that `rpm` is available.
Distroless: https://github.com/GoogleContainerTools/distroless
## Application Dependencies
@@ -1225,7 +1275,18 @@ The unfixed/unfixable vulnerabilities mean that the patch has not yet been provi
The path of these files does not matter.
Example: https://npm.pkg.github.com/aquasecurity/trivy-ci-test/blob/master/Dockerfile
Example: https://github.com/aquasecurity/trivy-ci-test/blob/master/Dockerfile
## Image Tar format
Trivy scans a tar image with the following format.
- Docker Image Specification (https://github.com/moby/moby/tree/master/image/spec)
- Moby Project (https://github.com/moby/moby/)
- Buildah, Podman (https://github.com/containers/buildah)
- img (https://github.com/genuinetools/img)
- Kaniko
- Kaniko (https://github.com/GoogleContainerTools/kaniko)
### Data source
- PHP
@@ -1247,25 +1308,33 @@ NAME:
USAGE:
main [options] image_name
VERSION:
0.0.15
0.2.0
OPTIONS:
--format value, -f value format (table, json) (default: "table")
--input value, -i value input file path instead of image name
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--output value, -o value output file name
--exit-code value Exit code when vulnerabilities were found (default: 0)
--skip-update skip db update
--reset remove all caches and database
--clear-cache, -c clear image caches
--quiet, -q suppress progress bar
--ignore-unfixed display only fixed vulnerabilities
--refresh refresh DB (usually used after version update of trivy)
--auto-refresh refresh DB automatically when updating version of trivy
--debug, -d debug mode
--vuln-type value comma-separated list of vulnerability types (os,library)
--cache-dir value cache directory (default: "/path/to/cache")
--template value, -t value output template [$TRIVY_TEMPLATE]
--format value, -f value format (table, json, template) (default: "table") [$TRIVY_FORMAT]
--input value, -i value input file path instead of image name [$TRIVY_INPUT]
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
--output value, -o value output file name [$TRIVY_OUTPUT]
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
--skip-update skip db update [$TRIVY_SKIP_UPDATE]
--download-db-only download/update vulnerability database but don't run a scan [$TRIVY_DOWNLOAD_DB_ONLY]
--reset remove all caches and database [$TRIVY_RESET]
--clear-cache, -c clear image caches [$TRIVY_CLEAR_CACHE]
--quiet, -q suppress progress bar and log output [$TRIVY_QUIET]
--no-progress suppress progress bar [$TRIVY_NO_PROGRESS]
--ignore-unfixed display only fixed vulnerabilities [$TRIVY_IGNORE_UNFIXED]
--debug, -d debug mode [$TRIVY_DEBUG]
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
--cache-dir value use as cache directory, but image cache is stored in /path/to/cache/fanal (default: "/Users/teppei/Library/Caches/trivy") [$TRIVY_CACHE_DIR]
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
--timeout value docker timeout (default: 1m0s) [$TRIVY_TIMEOUT]
--light light mode: it's faster, but vulnerability descriptions and references are not displayed
--only-update value deprecated [$TRIVY_ONLY_UPDATE]
--refresh deprecated [$TRIVY_REFRESH]
--auto-refresh deprecated [$TRIVY_AUTO_REFRESH]
--help, -h show help
--version, -v print the version
```
# Comparison with other scanners
@@ -1292,10 +1361,10 @@ As README says, it is not a complete database of all security issues in Alpine.
Then, those vulnerabilities will be saved on [vuln-list](https://github.com/aquasecurity/vuln-list/tree/master/alpine).
`alpine-secdb` has 6959 vulnerabilities (as of 2019/05/12).
`vuln-list` has 11101 vulnerabilities related with Alpine Linux (as of 2019/05/12).
`vuln-list` has 11101 vulnerabilities related to Alpine Linux (as of 2019/05/12).
There is a difference in detection accuracy because the number of vulnerabilities is nearly doubled.
In addition, `Trivy` analyzes the middle layer as well and find out which version of the library was used for static linking.
In addition, `Trivy` analyzes the middle layers as well to find out which version of the library was used for static linking.
`Clair` can not handle the following cases because it analyzes the image after applying all layers.
@@ -1309,6 +1378,8 @@ RUN apk add --no-cache sqlite-dev \
And as many people know, it is difficult to select a `Clair` client because many clients are deprecated.
Trivy is a stand-alone tool and can scan very fast. This means it's very easy to use in CI/CD.
Finally, `Trivy` can also detect vulnerabilities in application dependent libraries such as Bundler, Composer, Pipenv, etc.
## vs Anchore Engine
@@ -1321,13 +1392,13 @@ Also, `Anchore Engine` needs some steps to start scanning.
## vs Quay, Docker Hub, GCR
As `Quay` seems to use `Clair` internally, it has the same accuracy than `Clair`. `Docker Hub` can scan only official images. `GCR` hardly detects vulnerabilities on Alpine Linux. Also, it is locked to a specific registry.
As `Quay` uses `Clair` internally, it has the same accuracy as `Clair`. `Docker Hub` can scan only official images. `GCR` hardly detects vulnerabilities on Alpine Linux. Also, it is locked to a specific registry.
`Trivy` can be used regardless of the registry. In addition, it is easy to be integrated with CI/CD services.
`Trivy` can be used regardless of the registry, and it is easily integrated with CI/CD services.
# Migration
On 19 August 2019, Trivy's repositories moved from `knqyf263/trivy` to `aquasecurity/trivy`. If you previously installed Trivy you should update any scripts or package manager records as described in this section.
On 19 August 2019, Trivy's repositories moved from `knqyf263/trivy` to `aquasecurity/trivy`. If you previously installed Trivy you should update any scripts or package manager records as described in this section.
## Overview
If you have a script that installs Trivy (for example into your CI pipelines) you should update it to obtain it from the new location by replacing knqyf263/trivy with aquasecurity/trivy.
@@ -1367,7 +1438,7 @@ Tap aquasecurity/trivy
```bash
$ brew uninstall --force trivy
$ brew untap knqyf263/trivy
$ brew install aquasecurity/trivy
$ brew install aquasecurity/trivy/trivy
```
## Binary (Including Windows)
@@ -1414,17 +1485,9 @@ $ brew install aquasecurity/trivy/trivy
## Others
### Detected version update of trivy. Please try again with --refresh option
Try again with `--refresh` option
```
$ trivy --refresh alpine:3.9
```
### Unknown error
Try again with `--reset` option
Try again with `--reset` option:
```
$ trivy --reset
@@ -1432,20 +1495,8 @@ $ trivy --reset
# Related Projects
- [Remic](https://github.com/aquasecurity/remic)
- Vulnerability Scanner for Detecting Publicly Disclosed Vulnerabilities in Application Dependencies
# Contribute
1. fork a repository: github.com/aquasecurity/trivy to github.com/you/repo
2. get original code: `go get github.com/aquasecurity/trivy`
3. work on original code
4. add remote to your repo: git remote add myfork https://github.com/you/repo.git
5. push your changes: git push myfork
6. create a new Pull Request
- see [GitHub and Go: forking, pull requests, and go-getting](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)
- [Remic](https://github.com/knqyf263/remic)
- Vulnerability Scanner for Detecting Publicly Disclosed Vulnerabilities in Application Dependencies
---
# Credits
@@ -1456,8 +1507,8 @@ $ trivy --reset
# License
AGPLv3
This repository is available under the [GNU Affero General Public License v3.0](https://github.com/aquasecurity/trivy/blob/master/LICENSE)
# Author
Teppei Fukuda (knqyf263)
[Teppei Fukuda](https://github.com/knqyf263) (knqyf263)

View File

@@ -1,20 +1,10 @@
FROM bepsays/ci-goreleaser:1.12-2
FROM circleci/golang:1.13-buster
RUN apt-get -y update \
&& apt-get -y install vim rpm reprepro createrepo \
&& wget https://dl.bintray.com/homebrew/mirror/berkeley-db-18.1.32.tar.gz \
RUN sudo apt-get -y update \
&& sudo apt-get -y install rpm reprepro createrepo
# Berkeley DB
&& tar zxvf berkeley-db-18.1.32.tar.gz \
&& cd db-18.1.32/build_unix \
# Linux
&& ../dist/configure --prefix=/usr/local --host=x86_64-linux \
&& make \
&& make install \
# Darwin
&& make clean \
&& ../dist/configure --prefix=/usr/local --host=x86_64-apple-darwin15 \
&& make \
&& make install
ARG GORELEASER_VERSION=0.110.0
ARG GORELEASER_ARTIFACT=goreleaser_Linux_x86_64.tar.gz
RUN wget https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/${GORELEASER_ARTIFACT} \
&& sudo tar -xzf ${GORELEASER_ARTIFACT} -C /usr/bin/ goreleaser \
&& rm ${GORELEASER_ARTIFACT}

View File

@@ -1,18 +1,25 @@
#!/bin/sh
#!/bin/bash
RPM_EL6=$(find dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -e 's/_/-/g' -e 's/-Linux/.el6/' -e 's/-64bit/.x86_64/')
RPM_EL7=$(find dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -e 's/_/-/g' -e 's/-Linux/.el7/' -e 's/-64bit/.x86_64/')
function create_rpm_repo () {
version=$1
rpm_path=rpm/releases/${version}/x86_64
RPM_EL=$(find ../dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -e "s/_/-/g" -e "s/-Linux/.el$version/" -e "s/-64bit/.x86_64/")
echo $RPM_EL
mkdir -p $rpm_path
cp ../dist/*64bit.rpm ${rpm_path}/${RPM_EL}
createrepo --update $rpm_path
}
cd trivy-repo
mkdir -p rpm/releases/6/x86_64
mkdir -p rpm/releases/7/x86_64
cd rpm
cp ../../dist/*64bit.rpm releases/6/x86_64/${RPM_EL6}
cp ../../dist/*64bit.rpm releases/7/x86_64/${RPM_EL7}
createrepo --update releases/6/x86_64/
createrepo --update releases/7/x86_64/
VERSIONS=(5 6 7 8)
for version in ${VERSIONS[@]}; do
echo "Processing RHEL/CentOS $version..."
create_rpm_repo $version
done
git add .
git commit -m "Update rpm packages"

View File

@@ -3,13 +3,6 @@ package main
import (
l "log"
"os"
"strings"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/urfave/cli"
"github.com/aquasecurity/trivy/pkg"
"github.com/aquasecurity/trivy/pkg/log"
@@ -20,107 +13,7 @@ var (
)
func main() {
cli.AppHelpTemplate = `NAME:
{{.Name}}{{if .Usage}} - {{.Usage}}{{end}}
USAGE:
{{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Version}}{{if not .HideVersion}}
VERSION:
{{.Version}}{{end}}{{end}}{{if .Description}}
DESCRIPTION:
{{.Description}}{{end}}{{if len .Authors}}
AUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}:
{{range $index, $author := .Authors}}{{if $index}}
{{end}}{{$author}}{{end}}{{end}}{{if .VisibleCommands}}
OPTIONS:
{{range $index, $option := .VisibleFlags}}{{if $index}}
{{end}}{{$option}}{{end}}{{end}}
`
app := cli.NewApp()
app.Name = "trivy"
app.Version = version
app.ArgsUsage = "image_name"
app.Usage = "A simple and comprehensive vulnerability scanner for containers"
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "format, f",
Value: "table",
Usage: "format (table, json)",
},
cli.StringFlag{
Name: "input, i",
Value: "",
Usage: "input file path instead of image name",
},
cli.StringFlag{
Name: "severity, s",
Value: strings.Join(vulnerability.SeverityNames, ","),
Usage: "severities of vulnerabilities to be displayed (comma separated)",
},
cli.StringFlag{
Name: "output, o",
Usage: "output file name",
},
cli.IntFlag{
Name: "exit-code",
Usage: "Exit code when vulnerabilities were found",
Value: 0,
},
cli.BoolFlag{
Name: "skip-update",
Usage: "skip db update",
},
cli.StringFlag{
Name: "only-update",
Usage: "update db only specified distribution (comma separated)",
},
cli.BoolFlag{
Name: "reset",
Usage: "remove all caches and database",
},
cli.BoolFlag{
Name: "clear-cache, c",
Usage: "clear image caches",
},
cli.BoolFlag{
Name: "quiet, q",
Usage: "suppress progress bar and log output",
},
cli.BoolFlag{
Name: "no-progress",
Usage: "suppress progress bar",
},
cli.BoolFlag{
Name: "ignore-unfixed",
Usage: "display only fixed vulnerabilities",
},
cli.BoolFlag{
Name: "refresh",
Usage: "refresh DB (usually used after version update of trivy)",
},
cli.BoolFlag{
Name: "auto-refresh",
Usage: "refresh DB automatically when updating version of trivy",
},
cli.BoolFlag{
Name: "debug, d",
Usage: "debug mode",
},
cli.StringFlag{
Name: "vuln-type",
Value: "os,library",
Usage: "comma-separated list of vulnerability types (os,library)",
},
cli.StringFlag{
Name: "cache-dir",
Value: utils.DefaultCacheDir(),
Usage: "cache directory",
},
}
app.Action = pkg.Run
app := pkg.NewApp(version)
err := app.Run(os.Args)
if err != nil {
if log.Logger != nil {

31
go.mod
View File

@@ -1,38 +1,31 @@
module github.com/aquasecurity/trivy
go 1.12
go 1.13
require (
github.com/BurntSushi/toml v0.3.1
github.com/aquasecurity/fanal v0.0.0-20190819081512-f04452b627c6
github.com/aquasecurity/fanal v0.0.0-20191015084852-e80236018d26
github.com/aquasecurity/go-dep-parser v0.0.0-20190819075924-ea223f0ef24b
github.com/aquasecurity/trivy-db v0.0.0-20191101193735-bb56553762c0
github.com/briandowns/spinner v0.0.0-20190319032542-ac46072a5a91
github.com/caarlos0/env/v6 v6.0.0
github.com/emirpasic/gods v1.12.0 // indirect
github.com/etcd-io/bbolt v1.3.2
github.com/fatih/color v1.7.0
github.com/genuinetools/reg v0.16.0
github.com/gliderlabs/ssh v0.1.3 // indirect
github.com/google/go-github/v28 v28.1.1
github.com/knqyf263/go-deb-version v0.0.0-20190517075300-09fca494f03d
github.com/knqyf263/go-rpm-version v0.0.0-20170716094938-74609b86c936
github.com/knqyf263/go-version v1.1.1
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/kylelemons/godebug v1.1.0
github.com/olekukonko/tablewriter v0.0.2-0.20190607075207-195002e6e56a
github.com/stretchr/testify v1.4.0
github.com/urfave/cli v1.20.0
github.com/xanzy/ssh-agent v0.2.1 // indirect
go.etcd.io/bbolt v1.3.2 // indirect
go.uber.org/atomic v1.3.2 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.9.1
golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373
golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582 // indirect
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
golang.org/x/sys v0.0.0-20191020152052-9984515f0562 // indirect
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898
gopkg.in/cheggaaa/pb.v1 v1.0.28
gopkg.in/src-d/go-billy.v4 v4.3.0 // indirect
gopkg.in/src-d/go-git-fixtures.v3 v3.4.0 // indirect
gopkg.in/src-d/go-git.v4 v4.10.0
gopkg.in/yaml.v2 v2.2.2
gopkg.in/yaml.v2 v2.2.4 // indirect
k8s.io/utils v0.0.0-20191010214722-8d271d903fe4
)
replace github.com/genuinetools/reg => github.com/tomoyamachi/reg v0.16.1-0.20190706172545-2a2250fd7c00

60
go.sum
View File

@@ -22,10 +22,18 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/aquasecurity/fanal v0.0.0-20190819081512-f04452b627c6 h1:pkl+kEW4KeLDPLfDtzjXa+zHOcS4YWSQuSTZ2kWO2GE=
github.com/aquasecurity/fanal v0.0.0-20190819081512-f04452b627c6/go.mod h1:enEz4FFetw4XAbkffaYgyCVq1556R9Ry+noqT4rq9BE=
github.com/aquasecurity/fanal v0.0.0-20191015084852-e80236018d26 h1:HvyiDHbYDm094Oo59MWIWtZ3Lt2Uu6nQ06IsG2jvIrg=
github.com/aquasecurity/fanal v0.0.0-20191015084852-e80236018d26/go.mod h1:dD1Ny21eY5FSDyERfUIMwdgYhg6Lnw611VOwDHmTSoQ=
github.com/aquasecurity/go-dep-parser v0.0.0-20190819075924-ea223f0ef24b h1:55Ulc/gvfWm4ylhVaR7MxOwujRjA6et7KhmUbSgUFf4=
github.com/aquasecurity/go-dep-parser v0.0.0-20190819075924-ea223f0ef24b/go.mod h1:BpNTD9vHfrejKsED9rx04ldM1WIbeyXGYxUrqTVwxVQ=
github.com/aquasecurity/trivy v0.1.6/go.mod h1:5hobyhxLzDtxruHzPxpND2PUKOssvGUdE9BocpJUwo4=
github.com/aquasecurity/trivy-db v0.0.0-20191101193735-bb56553762c0 h1:G6DzbsaARDzEuT3SdUdXw6GBH3RHhhkoaX1YQtwqYyI=
github.com/aquasecurity/trivy-db v0.0.0-20191101193735-bb56553762c0/go.mod h1:PCxSRIDg26j0v3NgjjFbA3BqrGVLSEu1Fb/n/0RzXzg=
github.com/aquasecurity/vuln-list-update v0.0.0-20191016075347-3d158c2bf9a2 h1:xbdUfr2KE4THsFx9CFWtWpU91lF+YhgP46moV94nYTA=
github.com/aquasecurity/vuln-list-update v0.0.0-20191016075347-3d158c2bf9a2/go.mod h1:6NhOP0CjZJL27bZZcaHECtzWdwDDm2g6yCY0QgXEGQQ=
github.com/araddon/dateparse v0.0.0-20190426192744-0d74ffceef83 h1:ukTLOeMC0aVxbJWVg6hOsVJ0VPIo8w++PbNsze/pqF8=
github.com/araddon/dateparse v0.0.0-20190426192744-0d74ffceef83/go.mod h1:SLqhdZcd+dF3TEVL2RMoob5bBP5R1P1qkox+HtCBgGI=
github.com/aws/aws-sdk-go v1.19.11 h1:tqaTGER6Byw3QvsjGW0p018U2UOqaJPeJuzoaF7jjoQ=
github.com/aws/aws-sdk-go v1.19.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
@@ -68,11 +76,17 @@ github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNE
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f h1:8GDPb0tCY8LQ+OJ3dbHb5sA6YZWXFORQYZx5sdsTlMs=
github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f h1:AUj1VoZUfhPhOPHULCQQDnGhRelpFWHMLhQVWDsS0v4=
github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
github.com/emirpasic/gods v1.9.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/etcd-io/bbolt v1.3.2 h1:RLRQ0TKLX7DlBRXAJHvbmXL17Q3KNnTBtZ9B6Qo+/Y0=
github.com/etcd-io/bbolt v1.3.2/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
github.com/etcd-io/bbolt v1.3.3 h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM=
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
@@ -105,15 +119,23 @@ github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-github/v28 v28.1.1 h1:kORf5ekX5qwXO2mGzXXOjMe/g6ap8ahVe0sBEulhSxo=
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.1 h1:Dw4jY2nghMMRsh1ol8dv1axHkDwMQK2DHerMNJsIpJU=
github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
@@ -122,6 +144,8 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e h1:RgQk53JHp/Cjunrr1WlsXSZpqXn+uREuHvUVcK82CV8=
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
@@ -149,10 +173,14 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-jsonpointer v0.0.0-20180225143300-37667080efed h1:fCWISZq4YN4ulCJx7x0KB15rqxLEe3mtNJL8cSOGKZU=
github.com/mattn/go-jsonpointer v0.0.0-20180225143300-37667080efed/go.mod h1:SDJ4hurDYyQ9/7nc+eCYtXqdufgK4Cq9TJlwPklqEYA=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
@@ -176,6 +204,8 @@ github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM
github.com/opencontainers/runc v0.1.1 h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJGY8Y=
github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/parnurzeal/gorequest v0.2.16 h1:T/5x+/4BT+nj+3eSknXmCTnEVGSzFzPGdpqmUVVZXHQ=
github.com/parnurzeal/gorequest v0.2.16/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE=
github.com/pelletier/go-buffruneio v0.2.0 h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA=
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
github.com/peterhellberg/link v1.0.0 h1:mUWkiegowUXEcmlb+ybF75Q/8D2Y0BjZtR8cxoKhaQo=
@@ -208,21 +238,31 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzr
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shurcooL/httpfs v0.0.0-20181222201310-74dc9339e414/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8=
github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/tomoyamachi/reg v0.16.1-0.20190706172545-2a2250fd7c00 h1:0e4vRd9YqnQBIAIAE39jLKDWffRfJWxloyWwcaMAQho=
github.com/tomoyamachi/reg v0.16.1-0.20190706172545-2a2250fd7c00/go.mod h1:RQE7h2jyIxekQZ24/wad0c9RGP+KSq4XzHh7h83ALi8=
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
@@ -259,6 +299,8 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c h1:uOCk1iQW6Vc18bnC13MfzScl+wdKBmM9Y9kU7Z83/lw=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582 h1:p9xBe/w/OzkeYVKm234g55gMdD1nSIooTir5kV11kfA=
golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -278,8 +320,11 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190506115046-ca7f33d4116e h1:bq5BY1tGuaK8HxuwN6pT6kWgTVLeJ5KwuyBpsl1CZL4=
golang.org/x/sys v0.0.0-20190506115046-ca7f33d4116e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191020152052-9984515f0562 h1:wOweSabW7qssfcg63CEDHHA4zyoqRlGU6eYV7IUMCq0=
golang.org/x/sys v0.0.0-20191020152052-9984515f0562/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -296,9 +341,14 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190503185657-3b6f9c0030f7/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373 h1:PPwnA7z1Pjf7XYaBP9GL1VAMZmcIWyFz7QCMSIIa3Bg=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
@@ -321,6 +371,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk=
gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
gopkg.in/src-d/go-billy.v4 v4.2.1/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk=
gopkg.in/src-d/go-billy.v4 v4.3.0 h1:KtlZ4c1OWbIs4jCv5ZXrTqG8EQocr0g/d4DjNg70aek=
gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk=
@@ -335,8 +386,15 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/utils v0.0.0-20191010214722-8d271d903fe4 h1:Gi+/O1saihwDqnlmC8Vhv1M5Sp4+rbOmK9TbsLn8ZEA=
k8s.io/utils v0.0.0-20191010214722-8d271d903fe4/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8=
moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE=

View File

@@ -1,6 +1,7 @@
project_name: trivy
builds:
- main: cmd/trivy/main.go
-
main: cmd/trivy/main.go
binary: trivy
ldflags:
- -s -w
@@ -22,60 +23,79 @@ builds:
goarm:
- 7
nfpm:
formats:
- deb
- rpm
dependencies:
- rpm
vendor: "aquasecurity"
homepage: "https://github.com/aquasecurity"
maintainer: "Teppei Fukuda <knqyf263@gmail.com>"
description: "A Fast Vulnerability Scanner for Containers"
license: "MIT"
name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}"
replacements:
amd64: 64bit
386: 32bit
arm: ARM
arm64: ARM64
darwin: macOS
linux: Linux
windows: Windows
openbsd: OpenBSD
netbsd: NetBSD
freebsd: FreeBSD
dragonfly: DragonFlyBSD
nfpms:
-
formats:
- deb
- rpm
dependencies:
- rpm
vendor: "aquasecurity"
homepage: "https://github.com/aquasecurity"
maintainer: "Teppei Fukuda <knqyf263@gmail.com>"
description: "A Fast Vulnerability Scanner for Containers"
license: "MIT"
name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}"
replacements:
amd64: 64bit
386: 32bit
arm: ARM
arm64: ARM64
darwin: macOS
linux: Linux
windows: Windows
openbsd: OpenBSD
netbsd: NetBSD
freebsd: FreeBSD
dragonfly: DragonFlyBSD
archive:
format: tar.gz
format_overrides:
- goos: windows
format: zip
name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}"
replacements:
amd64: 64bit
386: 32bit
arm: ARM
arm64: ARM64
darwin: macOS
linux: Linux
windows: Windows
openbsd: OpenBSD
netbsd: NetBSD
freebsd: FreeBSD
dragonfly: DragonFlyBSD
files:
- README.md
- LICENSE
archives:
-
format: tar.gz
format_overrides:
- goos: windows
format: zip
name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}"
replacements:
amd64: 64bit
386: 32bit
arm: ARM
arm64: ARM64
darwin: macOS
linux: Linux
windows: Windows
openbsd: OpenBSD
netbsd: NetBSD
freebsd: FreeBSD
dragonfly: DragonFlyBSD
files:
- README.md
- LICENSE
brew:
github:
owner: aquasecurity
name: homebrew-trivy
dependencies:
- rpm
homepage: "https://github.com/aquasecurity/trivy"
description: ""
test: |
system "#{bin}/program --version"
brews:
-
github:
owner: aquasecurity
name: homebrew-trivy
dependencies:
- rpm
homepage: "https://github.com/aquasecurity/trivy"
description: ""
test: |
system "#{bin}/program --version"
dockers:
- image_templates:
- "docker.io/aquasec/trivy:{{ .Version }}"
- "docker.io/aquasec/trivy:latest"
binaries:
- trivy
build_flag_templates:
- "--label=org.label-schema.schema-version=1.0"
- "--label=org.label-schema.name={{ .ProjectName }}"
- "--label=org.label-schema.description=A Fast Vulnerability Scanner for Containers"
- "--label=org.label-schema.vendor=Aqua Security"
- "--label=org.label-schema.version={{ .Version }}"
- "--label=org.label-schema.build-date={{ .Date }}"
- "--label=org.label-schema.vcs=https://github.com/aquasecurity/trivy"
- "--label=org.label-schema.vcs-ref={{ .FullCommit }}"

View File

@@ -0,0 +1,363 @@
// +build integration
package integration_test
import (
"compress/gzip"
"flag"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/aquasecurity/trivy/pkg"
)
var update = flag.Bool("update", false, "update golden files")
func gunzipDB() string {
gz, err := os.Open("testdata/trivy.db.gz")
if err != nil {
log.Panic(err)
}
zr, err := gzip.NewReader(gz)
if err != nil {
log.Panic(err)
}
tmpDir, err := ioutil.TempDir("", "integration")
if err != nil {
log.Panic(err)
}
dbDir := filepath.Join(tmpDir, "db")
err = os.MkdirAll(dbDir, 0700)
if err != nil {
log.Panic(err)
}
file, err := os.Create(filepath.Join(dbDir, "trivy.db"))
if err != nil {
log.Panic(err)
}
defer file.Close()
_, err = io.Copy(file, zr)
if err != nil {
log.Panic(err)
}
return tmpDir
}
func TestRun_WithTar(t *testing.T) {
type args struct {
Version string
SkipUpdate bool
IgnoreUnfixed bool
Severity []string
IgnoreIDs []string
Format string
Input string
}
cases := []struct {
name string
testArgs args
golden string
}{
{
name: "alpine 3.10 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/alpine-310.tar.gz",
},
golden: "testdata/alpine-310.json.golden",
},
{
name: "alpine 3.10 integration with --ignore-unfixed option",
testArgs: args{
Version: "dev",
SkipUpdate: true,
IgnoreUnfixed: true,
Format: "json",
Input: "testdata/fixtures/alpine-310.tar.gz",
},
golden: "testdata/alpine-310-ignore-unfixed.json.golden",
},
{
name: "alpine 3.10 integration with medium and high severity",
testArgs: args{
Version: "dev",
SkipUpdate: true,
IgnoreUnfixed: true,
Severity: []string{"MEDIUM", "HIGH"},
Format: "json",
Input: "testdata/fixtures/alpine-310.tar.gz",
},
golden: "testdata/alpine-310-medium-high.json.golden",
},
{
name: "alpine 3.10 integration with .trivyignore",
testArgs: args{
Version: "dev",
SkipUpdate: true,
IgnoreUnfixed: false,
IgnoreIDs: []string{"CVE-2019-1549", "CVE-2019-1563"},
Format: "json",
Input: "testdata/fixtures/alpine-310.tar.gz",
},
golden: "testdata/alpine-310-ignore-cveids.json.golden",
},
{
name: "alpine 3.9 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/alpine-39.tar.gz",
},
golden: "testdata/alpine-39.json.golden",
},
{
name: "debian buster integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/debian-buster.tar.gz",
},
golden: "testdata/debian-buster.json.golden",
},
{
name: "debian buster integration with --ignore-unfixed option",
testArgs: args{
Version: "dev",
SkipUpdate: true,
IgnoreUnfixed: true,
Format: "json",
Input: "testdata/fixtures/debian-buster.tar.gz",
},
golden: "testdata/debian-buster-ignore-unfixed.json.golden",
},
{
name: "debian stretch integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/debian-stretch.tar.gz",
},
golden: "testdata/debian-stretch.json.golden",
},
{
name: "ubuntu 18.04 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/ubuntu-1804.tar.gz",
},
golden: "testdata/ubuntu-1804.json.golden",
},
{
name: "ubuntu 18.04 integration with --ignore-unfixed option",
testArgs: args{
Version: "dev",
SkipUpdate: true,
IgnoreUnfixed: true,
Format: "json",
Input: "testdata/fixtures/ubuntu-1804.tar.gz",
},
golden: "testdata/ubuntu-1804-ignore-unfixed.json.golden",
},
{
name: "ubuntu 16.04 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/ubuntu-1604.tar.gz",
},
golden: "testdata/ubuntu-1604.json.golden",
},
{
name: "centos 7 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/centos-7.tar.gz",
},
golden: "testdata/centos-7.json.golden",
},
{
name: "centos 7 integration with --ignore-unfixed option",
testArgs: args{
Version: "dev",
SkipUpdate: true,
IgnoreUnfixed: true,
Format: "json",
Input: "testdata/fixtures/centos-7.tar.gz",
},
golden: "testdata/centos-7-ignore-unfixed.json.golden",
},
{
name: "centos 7 integration with critical severity",
testArgs: args{
Version: "dev",
SkipUpdate: true,
IgnoreUnfixed: true,
Severity: []string{"CRITICAL"},
Format: "json",
Input: "testdata/fixtures/centos-7.tar.gz",
},
golden: "testdata/centos-7-critical.json.golden",
},
{
name: "centos 7 integration with low and high severity",
testArgs: args{
Version: "dev",
SkipUpdate: true,
IgnoreUnfixed: true,
Severity: []string{"LOW", "HIGH"},
Format: "json",
Input: "testdata/fixtures/centos-7.tar.gz",
},
golden: "testdata/centos-7-low-high.json.golden",
},
{
name: "centos 6 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/centos-6.tar.gz",
},
golden: "testdata/centos-6.json.golden",
},
{
name: "ubi 7 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/ubi-7.tar.gz",
},
golden: "testdata/ubi-7.json.golden",
},
{
name: "distroless base integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/distroless-base.tar.gz",
},
golden: "testdata/distroless-base.json.golden",
},
{
name: "distroless base integration with --ignore-unfixed option",
testArgs: args{
Version: "dev",
SkipUpdate: true,
IgnoreUnfixed: true,
Format: "json",
Input: "testdata/fixtures/distroless-base.tar.gz",
},
golden: "testdata/distroless-base-ignore-unfixed.json.golden",
},
{
name: "distroless python27 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/distroless-python27.tar.gz",
},
golden: "testdata/distroless-python27.json.golden",
},
{
name: "amazon 1 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/amazon-1.tar.gz",
},
golden: "testdata/amazon-1.json.golden",
},
{
name: "amazon 2 integration",
testArgs: args{
Version: "dev",
SkipUpdate: true,
Format: "json",
Input: "testdata/fixtures/amazon-2.tar.gz",
},
golden: "testdata/amazon-2.json.golden",
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
// Copy DB file
cacheDir := gunzipDB()
defer os.RemoveAll(cacheDir)
// Setup CLI App
app := pkg.NewApp(c.testArgs.Version)
app.Writer = ioutil.Discard
osArgs := []string{"trivy", "--cache-dir", cacheDir, "--format", c.testArgs.Format}
if c.testArgs.SkipUpdate {
osArgs = append(osArgs, "--skip-update")
}
if c.testArgs.IgnoreUnfixed {
osArgs = append(osArgs, "--ignore-unfixed")
}
if len(c.testArgs.Severity) != 0 {
osArgs = append(osArgs,
[]string{"--severity", strings.Join(c.testArgs.Severity, ",")}...,
)
}
if len(c.testArgs.IgnoreIDs) != 0 {
trivyIgnore := ".trivyignore"
err := ioutil.WriteFile(trivyIgnore, []byte(strings.Join(c.testArgs.IgnoreIDs, "\n")), 0444)
assert.NoError(t, err, "failed to write .trivyignore")
defer os.Remove(trivyIgnore)
}
if c.testArgs.Input != "" {
osArgs = append(osArgs, []string{"--input", c.testArgs.Input}...)
}
// Setup the output file
var outputFile string
if *update {
outputFile = c.golden
} else {
output, _ := ioutil.TempFile("", "integration")
assert.Nil(t, output.Close())
defer os.Remove(output.Name())
outputFile = output.Name()
}
osArgs = append(osArgs, []string{"--output", outputFile}...)
// Run Trivy
assert.Nil(t, app.Run(osArgs))
// Compare want and got
want, err := ioutil.ReadFile(c.golden)
assert.NoError(t, err)
got, err := ioutil.ReadFile(outputFile)
assert.NoError(t, err)
assert.JSONEq(t, string(want), string(got))
})
}
}

View File

@@ -0,0 +1,27 @@
[
{
"Target": "testdata/fixtures/alpine-310.tar.gz (alpine 3.10.2)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-1547",
"PkgName": "openssl",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: side-channel weak encryption vulnerability",
"Description": "Normally in OpenSSL EC groups always have a co-factor present and this is used in side channel resistant code paths. However, in some cases, it is possible to construct a group using explicit parameters (instead of using a named curve). In those cases it is possible that such a group does not have the cofactor present. This can occur even where all the parameters match a known named curve. If such a curve is used then OpenSSL falls back to non-side channel resistant code paths which may result in full key recovery during an ECDSA signature operation. In order to be vulnerable an attacker would have to have the ability to time the creation of a large number of signatures where explicit parameters with no co-factor present are in use by an application using libcrypto. For the avoidance of doubt libssl is not vulnerable because explicit parameters are never used. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "LOW",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://arxiv.org/abs/1909.01785",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1547",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=21c856b75d81eff61aa63b4f036bb64a85bf6d46",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=30c22fa8b1d840036b8e203585738df62a03cec8",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=7c1709c2da5414f5b6133d00a03fc8c5bf996c7a",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
}
]
}
]

View File

@@ -0,0 +1,63 @@
[
{
"Target": "testdata/fixtures/alpine-310.tar.gz (alpine 3.10.2)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-1549",
"PkgName": "openssl",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: information disclosure in fork()",
"Description": "OpenSSL 1.1.1 introduced a rewritten random number generator (RNG). This was intended to include protection in the event of a fork() system call in order to ensure that the parent and child processes did not share the same RNG state. However this protection was not being used in the default case. A partial mitigation for this issue is that the output from a high precision timer is mixed into the RNG state so the likelihood of a parent and child process sharing state is significantly reduced. If an application already calls OPENSSL_init_crypto() explicitly using OPENSSL_INIT_ATFORK then this problem does not occur at all. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c).",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1549",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GY6SNRJP2S7Y42GIIDO3HXPNMDYN2U3A/",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://support.f5.com/csp/article/K44070243",
"https://www.openssl.org/news/secadv/20190910.txt"
]
},
{
"VulnerabilityID": "CVE-2019-1563",
"PkgName": "openssl",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: information disclosure in PKCS7_dataDecode and CMS_decrypt_set1_pkey",
"Description": "In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMS_decrypt or PKCS7_decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "MEDIUM",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1563",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=08229ad838c50f644d7e928e2eef147b4308ad64",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=631f94db0065c78181ca9ba5546ebc8bb3884b97",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
},
{
"VulnerabilityID": "CVE-2019-1547",
"PkgName": "openssl",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: side-channel weak encryption vulnerability",
"Description": "Normally in OpenSSL EC groups always have a co-factor present and this is used in side channel resistant code paths. However, in some cases, it is possible to construct a group using explicit parameters (instead of using a named curve). In those cases it is possible that such a group does not have the cofactor present. This can occur even where all the parameters match a known named curve. If such a curve is used then OpenSSL falls back to non-side channel resistant code paths which may result in full key recovery during an ECDSA signature operation. In order to be vulnerable an attacker would have to have the ability to time the creation of a large number of signatures where explicit parameters with no co-factor present are in use by an application using libcrypto. For the avoidance of doubt libssl is not vulnerable because explicit parameters are never used. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "LOW",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://arxiv.org/abs/1909.01785",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1547",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=21c856b75d81eff61aa63b4f036bb64a85bf6d46",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=30c22fa8b1d840036b8e203585738df62a03cec8",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=7c1709c2da5414f5b6133d00a03fc8c5bf996c7a",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
}
]
}
]

View File

@@ -0,0 +1,43 @@
[
{
"Target": "testdata/fixtures/alpine-310.tar.gz (alpine 3.10.2)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-1549",
"PkgName": "openssl",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: information disclosure in fork()",
"Description": "OpenSSL 1.1.1 introduced a rewritten random number generator (RNG). This was intended to include protection in the event of a fork() system call in order to ensure that the parent and child processes did not share the same RNG state. However this protection was not being used in the default case. A partial mitigation for this issue is that the output from a high precision timer is mixed into the RNG state so the likelihood of a parent and child process sharing state is significantly reduced. If an application already calls OPENSSL_init_crypto() explicitly using OPENSSL_INIT_ATFORK then this problem does not occur at all. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c).",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1549",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GY6SNRJP2S7Y42GIIDO3HXPNMDYN2U3A/",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://support.f5.com/csp/article/K44070243",
"https://www.openssl.org/news/secadv/20190910.txt"
]
},
{
"VulnerabilityID": "CVE-2019-1563",
"PkgName": "openssl",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: information disclosure in PKCS7_dataDecode and CMS_decrypt_set1_pkey",
"Description": "In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMS_decrypt or PKCS7_decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "MEDIUM",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1563",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=08229ad838c50f644d7e928e2eef147b4308ad64",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=631f94db0065c78181ca9ba5546ebc8bb3884b97",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
}
]
}
]

View File

@@ -0,0 +1,63 @@
[
{
"Target": "testdata/fixtures/alpine-310.tar.gz (alpine 3.10.2)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-1549",
"PkgName": "openssl",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: information disclosure in fork()",
"Description": "OpenSSL 1.1.1 introduced a rewritten random number generator (RNG). This was intended to include protection in the event of a fork() system call in order to ensure that the parent and child processes did not share the same RNG state. However this protection was not being used in the default case. A partial mitigation for this issue is that the output from a high precision timer is mixed into the RNG state so the likelihood of a parent and child process sharing state is significantly reduced. If an application already calls OPENSSL_init_crypto() explicitly using OPENSSL_INIT_ATFORK then this problem does not occur at all. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c).",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1549",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GY6SNRJP2S7Y42GIIDO3HXPNMDYN2U3A/",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://support.f5.com/csp/article/K44070243",
"https://www.openssl.org/news/secadv/20190910.txt"
]
},
{
"VulnerabilityID": "CVE-2019-1563",
"PkgName": "openssl",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: information disclosure in PKCS7_dataDecode and CMS_decrypt_set1_pkey",
"Description": "In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMS_decrypt or PKCS7_decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "MEDIUM",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1563",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=08229ad838c50f644d7e928e2eef147b4308ad64",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=631f94db0065c78181ca9ba5546ebc8bb3884b97",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
},
{
"VulnerabilityID": "CVE-2019-1547",
"PkgName": "openssl",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: side-channel weak encryption vulnerability",
"Description": "Normally in OpenSSL EC groups always have a co-factor present and this is used in side channel resistant code paths. However, in some cases, it is possible to construct a group using explicit parameters (instead of using a named curve). In those cases it is possible that such a group does not have the cofactor present. This can occur even where all the parameters match a known named curve. If such a curve is used then OpenSSL falls back to non-side channel resistant code paths which may result in full key recovery during an ECDSA signature operation. In order to be vulnerable an attacker would have to have the ability to time the creation of a large number of signatures where explicit parameters with no co-factor present are in use by an application using libcrypto. For the avoidance of doubt libssl is not vulnerable because explicit parameters are never used. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "LOW",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://arxiv.org/abs/1909.01785",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1547",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=21c856b75d81eff61aa63b4f036bb64a85bf6d46",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=30c22fa8b1d840036b8e203585738df62a03cec8",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=7c1709c2da5414f5b6133d00a03fc8c5bf996c7a",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
}
]
}
]

View File

@@ -0,0 +1,75 @@
[
{
"Target": "testdata/fixtures/alpine-39.tar.gz (alpine 3.9.4)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-14697",
"PkgName": "musl",
"InstalledVersion": "1.1.20-r4",
"FixedVersion": "1.1.20-r5",
"Description": "musl libc through 1.1.23 has an x87 floating-point stack adjustment imbalance, related to the math/i386/ directory. In some cases, use of this library could introduce out-of-bounds writes that are not present in an application's source code.",
"Severity": "HIGH",
"References": [
"http://www.openwall.com/lists/oss-security/2019/08/06/4",
"https://www.openwall.com/lists/musl/2019/08/06/1"
]
},
{
"VulnerabilityID": "CVE-2019-1549",
"PkgName": "openssl",
"InstalledVersion": "1.1.1b-r1",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: information disclosure in fork()",
"Description": "OpenSSL 1.1.1 introduced a rewritten random number generator (RNG). This was intended to include protection in the event of a fork() system call in order to ensure that the parent and child processes did not share the same RNG state. However this protection was not being used in the default case. A partial mitigation for this issue is that the output from a high precision timer is mixed into the RNG state so the likelihood of a parent and child process sharing state is significantly reduced. If an application already calls OPENSSL_init_crypto() explicitly using OPENSSL_INIT_ATFORK then this problem does not occur at all. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c).",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1549",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GY6SNRJP2S7Y42GIIDO3HXPNMDYN2U3A/",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://support.f5.com/csp/article/K44070243",
"https://www.openssl.org/news/secadv/20190910.txt"
]
},
{
"VulnerabilityID": "CVE-2019-1563",
"PkgName": "openssl",
"InstalledVersion": "1.1.1b-r1",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: information disclosure in PKCS7_dataDecode and CMS_decrypt_set1_pkey",
"Description": "In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMS_decrypt or PKCS7_decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "MEDIUM",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1563",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=08229ad838c50f644d7e928e2eef147b4308ad64",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=631f94db0065c78181ca9ba5546ebc8bb3884b97",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
},
{
"VulnerabilityID": "CVE-2019-1547",
"PkgName": "openssl",
"InstalledVersion": "1.1.1b-r1",
"FixedVersion": "1.1.1d-r0",
"Title": "openssl: side-channel weak encryption vulnerability",
"Description": "Normally in OpenSSL EC groups always have a co-factor present and this is used in side channel resistant code paths. However, in some cases, it is possible to construct a group using explicit parameters (instead of using a named curve). In those cases it is possible that such a group does not have the cofactor present. This can occur even where all the parameters match a known named curve. If such a curve is used then OpenSSL falls back to non-side channel resistant code paths which may result in full key recovery during an ECDSA signature operation. In order to be vulnerable an attacker would have to have the ability to time the creation of a large number of signatures where explicit parameters with no co-factor present are in use by an application using libcrypto. For the avoidance of doubt libssl is not vulnerable because explicit parameters are never used. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "LOW",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://arxiv.org/abs/1909.01785",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1547",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=21c856b75d81eff61aa63b4f036bb64a85bf6d46",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=30c22fa8b1d840036b8e203585738df62a03cec8",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=7c1709c2da5414f5b6133d00a03fc8c5bf996c7a",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
}
]
}
]

View File

@@ -0,0 +1,130 @@
[
{
"Target": "testdata/fixtures/amazon-1.tar.gz (amazon AMI release 2018.03)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-5481",
"PkgName": "curl",
"InstalledVersion": "7.61.1-11.91.amzn1",
"FixedVersion": "7.61.1-12.93.amzn1",
"Title": "curl: double free due to subsequent call of realloc()",
"Description": "Double-free vulnerability in the FTP-kerberos code in cURL 7.52.0 to 7.65.3.",
"Severity": "HIGH",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00048.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00055.html",
"https://curl.haxx.se/docs/CVE-2019-5481.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RGDVKSLY5JUNJRLYRUA6CXGQ2LM63XC3/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UA7KDM2WPM5CJDDGOEGFV6SSGD2J7RNT/"
]
},
{
"VulnerabilityID": "CVE-2019-5482",
"PkgName": "curl",
"InstalledVersion": "7.61.1-11.91.amzn1",
"FixedVersion": "7.61.1-12.93.amzn1",
"Title": "curl: heap buffer overflow in function tftp_receive_packet()",
"Description": "Heap buffer overflow in the TFTP protocol handler in cURL 7.19.4 to 7.65.3.",
"Severity": "HIGH",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00048.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00055.html",
"https://curl.haxx.se/docs/CVE-2019-5482.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5482",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RGDVKSLY5JUNJRLYRUA6CXGQ2LM63XC3/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UA7KDM2WPM5CJDDGOEGFV6SSGD2J7RNT/"
]
},
{
"VulnerabilityID": "CVE-2019-5481",
"PkgName": "libcurl",
"InstalledVersion": "7.61.1-11.91.amzn1",
"FixedVersion": "7.61.1-12.93.amzn1",
"Title": "curl: double free due to subsequent call of realloc()",
"Description": "Double-free vulnerability in the FTP-kerberos code in cURL 7.52.0 to 7.65.3.",
"Severity": "HIGH",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00048.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00055.html",
"https://curl.haxx.se/docs/CVE-2019-5481.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RGDVKSLY5JUNJRLYRUA6CXGQ2LM63XC3/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UA7KDM2WPM5CJDDGOEGFV6SSGD2J7RNT/"
]
},
{
"VulnerabilityID": "CVE-2019-5482",
"PkgName": "libcurl",
"InstalledVersion": "7.61.1-11.91.amzn1",
"FixedVersion": "7.61.1-12.93.amzn1",
"Title": "curl: heap buffer overflow in function tftp_receive_packet()",
"Description": "Heap buffer overflow in the TFTP protocol handler in cURL 7.19.4 to 7.65.3.",
"Severity": "HIGH",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00048.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00055.html",
"https://curl.haxx.se/docs/CVE-2019-5482.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5482",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RGDVKSLY5JUNJRLYRUA6CXGQ2LM63XC3/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UA7KDM2WPM5CJDDGOEGFV6SSGD2J7RNT/"
]
},
{
"VulnerabilityID": "CVE-2019-9511",
"PkgName": "libnghttp2",
"InstalledVersion": "1.21.1-1.4.amzn1",
"FixedVersion": "1.31.1-2.5.amzn1",
"Title": "HTTP/2: large amount of data requests leads to denial of service",
"Description": "Some HTTP/2 implementations are vulnerable to window size manipulation and stream prioritization manipulation, potentially leading to a denial of service. The attacker requests a large amount of data from a specified resource over multiple streams. They manipulate window size and stream priority to force the server to queue the data in 1-byte chunks. Depending on how efficiently this data is queued, this can consume excess CPU, memory, or both.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9511",
"https://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-002.md",
"https://kb.cert.org/vuls/id/605641/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BP556LEG3WENHZI5TAQ6ZEBFTJB4E2IS/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JUBYAF6ED3O4XCHQ5C2HYENJLXYXZC4M/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LZLUYPYY3RX4ZJDWZRJIKSULYRJ4PXW7/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TAZZEVTCN2B4WT6AIBJ7XGYJMBTORJU5/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XHTKU7YQ5EEP2XNSAV4M4VJ7QCBOJMOD/",
"https://nodejs.org/en/blog/vulnerability/aug-2019-security-releases/",
"https://seclists.org/bugtraq/2019/Aug/40",
"https://security.netapp.com/advisory/ntap-20190823-0002/",
"https://security.netapp.com/advisory/ntap-20190823-0005/",
"https://support.f5.com/csp/article/K02591030",
"https://usn.ubuntu.com/4099-1/",
"https://www.debian.org/security/2019/dsa-4505",
"https://www.nginx.com/blog/nginx-updates-mitigate-august-2019-http-2-vulnerabilities/",
"https://www.synology.com/security/advisory/Synology_SA_19_33"
]
},
{
"VulnerabilityID": "CVE-2019-9513",
"PkgName": "libnghttp2",
"InstalledVersion": "1.21.1-1.4.amzn1",
"FixedVersion": "1.31.1-2.5.amzn1",
"Title": "HTTP/2: flood using PRIORITY frames results in excessive resource consumption",
"Description": "Some HTTP/2 implementations are vulnerable to resource loops, potentially leading to a denial of service. The attacker creates multiple request streams and continually shuffles the priority of the streams in a way that causes substantial churn to the priority tree. This can consume excess CPU.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9513",
"https://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-002.md",
"https://kb.cert.org/vuls/id/605641/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4ZQGHE3WTYLYAYJEIDJVF2FIGQTAYPMC/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CMNFX5MNYRWWIMO4BTKYQCGUDMHO3AXP/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JUBYAF6ED3O4XCHQ5C2HYENJLXYXZC4M/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LZLUYPYY3RX4ZJDWZRJIKSULYRJ4PXW7/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TAZZEVTCN2B4WT6AIBJ7XGYJMBTORJU5/",
"https://nghttp2.org/blog/2019/08/19/nghttp2-v1-39-2/",
"https://nodejs.org/en/blog/vulnerability/aug-2019-security-releases/",
"https://seclists.org/bugtraq/2019/Aug/40",
"https://security.netapp.com/advisory/ntap-20190823-0002/",
"https://security.netapp.com/advisory/ntap-20190823-0005/",
"https://support.f5.com/csp/article/K02591030",
"https://usn.ubuntu.com/4099-1/",
"https://www.debian.org/security/2019/dsa-4505",
"https://www.nginx.com/blog/nginx-updates-mitigate-august-2019-http-2-vulnerabilities/",
"https://www.synology.com/security/advisory/Synology_SA_19_33"
]
}
]
}
]

View File

@@ -0,0 +1,953 @@
[
{
"Target": "testdata/fixtures/amazon-2.tar.gz (amazon 2 (Karoo))",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-5435",
"PkgName": "curl",
"InstalledVersion": "7.61.1-9.amzn2.0.1",
"FixedVersion": "7.61.1-11.amzn2.0.2",
"Title": "curl: Integer overflows in curl_url_set() function",
"Description": "An integer overflow in curl's URL API results in a buffer overflow in libcurl 7.62.0 to and including 7.64.1.",
"Severity": "MEDIUM",
"References": [
"https://curl.haxx.se/docs/CVE-2019-5435.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5435",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SMG3V4VTX2SE3EW3HQTN3DDLQBTORQC2/",
"https://security.netapp.com/advisory/ntap-20190606-0004/"
]
},
{
"VulnerabilityID": "CVE-2019-5436",
"PkgName": "curl",
"InstalledVersion": "7.61.1-9.amzn2.0.1",
"FixedVersion": "7.61.1-11.amzn2.0.2",
"Title": "curl: TFTP receive heap buffer overflow in tftp_receive_packet() function",
"Description": "A heap buffer overflow in the TFTP receiving code allows for DoS or arbitrary code execution in libcurl versions 7.19.4 through 7.64.1.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00008.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00017.html",
"https://curl.haxx.se/docs/CVE-2019-5436.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5436",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SMG3V4VTX2SE3EW3HQTN3DDLQBTORQC2/",
"https://security.netapp.com/advisory/ntap-20190606-0004/"
]
},
{
"VulnerabilityID": "CVE-2019-12450",
"PkgName": "glib2",
"InstalledVersion": "2.54.2-2.amzn2",
"FixedVersion": "2.56.1-4.amzn2",
"Title": "glib2: file_copy_fallback in gio/gfile.c in GNOME GLib does not properly restrict file permissions while a copy operation is in progress",
"Description": "file_copy_fallback in gio/gfile.c in GNOME GLib 2.15.0 through 2.61.1 does not properly restrict file permissions while a copy operation is in progress. Instead, default permissions are used.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12450",
"https://gitlab.gnome.org/GNOME/glib/commit/d8f8f4d637ce43f8699ba94c9b7648beda0ca174",
"https://lists.debian.org/debian-lts-announce/2019/06/msg00013.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2W4WIOAGO3M743M5KZLVQZM3NGHQDYLI/",
"https://security.netapp.com/advisory/ntap-20190606-0003/",
"https://usn.ubuntu.com/4014-1/",
"https://usn.ubuntu.com/4014-2/"
]
},
{
"VulnerabilityID": "CVE-2019-5435",
"PkgName": "libcurl",
"InstalledVersion": "7.61.1-9.amzn2.0.1",
"FixedVersion": "7.61.1-11.amzn2.0.2",
"Title": "curl: Integer overflows in curl_url_set() function",
"Description": "An integer overflow in curl's URL API results in a buffer overflow in libcurl 7.62.0 to and including 7.64.1.",
"Severity": "MEDIUM",
"References": [
"https://curl.haxx.se/docs/CVE-2019-5435.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5435",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SMG3V4VTX2SE3EW3HQTN3DDLQBTORQC2/",
"https://security.netapp.com/advisory/ntap-20190606-0004/"
]
},
{
"VulnerabilityID": "CVE-2019-5436",
"PkgName": "libcurl",
"InstalledVersion": "7.61.1-9.amzn2.0.1",
"FixedVersion": "7.61.1-11.amzn2.0.2",
"Title": "curl: TFTP receive heap buffer overflow in tftp_receive_packet() function",
"Description": "A heap buffer overflow in the TFTP receiving code allows for DoS or arbitrary code execution in libcurl versions 7.19.4 through 7.64.1.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00008.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00017.html",
"https://curl.haxx.se/docs/CVE-2019-5436.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5436",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SMG3V4VTX2SE3EW3HQTN3DDLQBTORQC2/",
"https://security.netapp.com/advisory/ntap-20190606-0004/"
]
},
{
"VulnerabilityID": "CVE-2019-9511",
"PkgName": "libnghttp2",
"InstalledVersion": "1.31.1-1.amzn2.0.2",
"FixedVersion": "1.39.2-1.amzn2",
"Title": "HTTP/2: large amount of data requests leads to denial of service",
"Description": "Some HTTP/2 implementations are vulnerable to window size manipulation and stream prioritization manipulation, potentially leading to a denial of service. The attacker requests a large amount of data from a specified resource over multiple streams. They manipulate window size and stream priority to force the server to queue the data in 1-byte chunks. Depending on how efficiently this data is queued, this can consume excess CPU, memory, or both.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9511",
"https://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-002.md",
"https://kb.cert.org/vuls/id/605641/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BP556LEG3WENHZI5TAQ6ZEBFTJB4E2IS/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JUBYAF6ED3O4XCHQ5C2HYENJLXYXZC4M/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LZLUYPYY3RX4ZJDWZRJIKSULYRJ4PXW7/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TAZZEVTCN2B4WT6AIBJ7XGYJMBTORJU5/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XHTKU7YQ5EEP2XNSAV4M4VJ7QCBOJMOD/",
"https://nodejs.org/en/blog/vulnerability/aug-2019-security-releases/",
"https://seclists.org/bugtraq/2019/Aug/40",
"https://security.netapp.com/advisory/ntap-20190823-0002/",
"https://security.netapp.com/advisory/ntap-20190823-0005/",
"https://support.f5.com/csp/article/K02591030",
"https://usn.ubuntu.com/4099-1/",
"https://www.debian.org/security/2019/dsa-4505",
"https://www.nginx.com/blog/nginx-updates-mitigate-august-2019-http-2-vulnerabilities/",
"https://www.synology.com/security/advisory/Synology_SA_19_33"
]
},
{
"VulnerabilityID": "CVE-2019-9513",
"PkgName": "libnghttp2",
"InstalledVersion": "1.31.1-1.amzn2.0.2",
"FixedVersion": "1.39.2-1.amzn2",
"Title": "HTTP/2: flood using PRIORITY frames results in excessive resource consumption",
"Description": "Some HTTP/2 implementations are vulnerable to resource loops, potentially leading to a denial of service. The attacker creates multiple request streams and continually shuffles the priority of the streams in a way that causes substantial churn to the priority tree. This can consume excess CPU.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9513",
"https://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-002.md",
"https://kb.cert.org/vuls/id/605641/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4ZQGHE3WTYLYAYJEIDJVF2FIGQTAYPMC/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CMNFX5MNYRWWIMO4BTKYQCGUDMHO3AXP/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JUBYAF6ED3O4XCHQ5C2HYENJLXYXZC4M/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LZLUYPYY3RX4ZJDWZRJIKSULYRJ4PXW7/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TAZZEVTCN2B4WT6AIBJ7XGYJMBTORJU5/",
"https://nghttp2.org/blog/2019/08/19/nghttp2-v1-39-2/",
"https://nodejs.org/en/blog/vulnerability/aug-2019-security-releases/",
"https://seclists.org/bugtraq/2019/Aug/40",
"https://security.netapp.com/advisory/ntap-20190823-0002/",
"https://security.netapp.com/advisory/ntap-20190823-0005/",
"https://support.f5.com/csp/article/K02591030",
"https://usn.ubuntu.com/4099-1/",
"https://www.debian.org/security/2019/dsa-4505",
"https://www.nginx.com/blog/nginx-updates-mitigate-august-2019-http-2-vulnerabilities/",
"https://www.synology.com/security/advisory/Synology_SA_19_33"
]
},
{
"VulnerabilityID": "CVE-2019-3858",
"PkgName": "libssh2",
"InstalledVersion": "1.4.3-12.amzn2.2",
"FixedVersion": "1.4.3-12.amzn2.2.1",
"Title": "libssh2: Zero-byte allocation with a specially crafted SFTP packed leading to an out-of-bounds read",
"Description": "An out of bounds read flaw was discovered in libssh2 before 1.8.1 when a specially crafted SFTP packet is received from the server. A remote attacker who compromises a SSH server may be able to cause a Denial of Service or read data in the client memory.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-03/msg00040.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00003.html",
"http://packetstormsecurity.com/files/152136/Slackware-Security-Advisory-libssh2-Updates.html",
"http://www.openwall.com/lists/oss-security/2019/03/18/3",
"http://www.securityfocus.com/bid/107485",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3858",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3858",
"https://lists.debian.org/debian-lts-announce/2019/03/msg00032.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5DK6VO2CEUTAJFYIKWNZKEKYMYR3NO2O/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XCWEA5ZCLKRDUK62QVVYMFWLWKOPX3LO/",
"https://seclists.org/bugtraq/2019/Apr/25",
"https://seclists.org/bugtraq/2019/Mar/25",
"https://security.netapp.com/advisory/ntap-20190327-0005/",
"https://www.broadcom.com/support/fibre-channel-networking/security-advisories/brocade-security-advisory-2019-767",
"https://www.debian.org/security/2019/dsa-4431",
"https://www.libssh2.org/CVE-2019-3858.html"
]
},
{
"VulnerabilityID": "CVE-2019-3861",
"PkgName": "libssh2",
"InstalledVersion": "1.4.3-12.amzn2.2",
"FixedVersion": "1.4.3-12.amzn2.2.1",
"Title": "libssh2: Out-of-bounds reads with specially crafted SSH packets",
"Description": "An out of bounds read flaw was discovered in libssh2 before 1.8.1 in the way SSH packets with a padding length value greater than the packet length are parsed. A remote attacker who compromises a SSH server may be able to cause a Denial of Service or read data in the client memory.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-03/msg00040.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00003.html",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3861",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3861",
"https://lists.debian.org/debian-lts-announce/2019/03/msg00032.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5DK6VO2CEUTAJFYIKWNZKEKYMYR3NO2O/",
"https://seclists.org/bugtraq/2019/Apr/25",
"https://security.netapp.com/advisory/ntap-20190327-0005/",
"https://www.debian.org/security/2019/dsa-4431",
"https://www.libssh2.org/CVE-2019-3861.html"
]
},
{
"VulnerabilityID": "CVE-2019-3862",
"PkgName": "libssh2",
"InstalledVersion": "1.4.3-12.amzn2.2",
"FixedVersion": "1.4.3-12.amzn2.2.2",
"Title": "libssh2: Out-of-bounds memory comparison with specially crafted message channel request",
"Description": "An out of bounds read flaw was discovered in libssh2 before 1.8.1 in the way SSH_MSG_CHANNEL_REQUEST packets with an exit status message and no payload are parsed. A remote attacker who compromises a SSH server may be able to cause a Denial of Service or read data in the client memory.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-03/msg00040.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00003.html",
"http://packetstormsecurity.com/files/152136/Slackware-Security-Advisory-libssh2-Updates.html",
"http://www.openwall.com/lists/oss-security/2019/03/18/3",
"http://www.securityfocus.com/bid/107485",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3862",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3862",
"https://lists.debian.org/debian-lts-announce/2019/03/msg00032.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5DK6VO2CEUTAJFYIKWNZKEKYMYR3NO2O/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XCWEA5ZCLKRDUK62QVVYMFWLWKOPX3LO/",
"https://seclists.org/bugtraq/2019/Apr/25",
"https://seclists.org/bugtraq/2019/Mar/25",
"https://security.netapp.com/advisory/ntap-20190327-0005/",
"https://www.broadcom.com/support/fibre-channel-networking/security-advisories/brocade-security-advisory-2019-767",
"https://www.debian.org/security/2019/dsa-4431",
"https://www.libssh2.org/CVE-2019-3862.html"
]
},
{
"VulnerabilityID": "CVE-2016-4658",
"PkgName": "libxml2",
"InstalledVersion": "2.9.1-6.amzn2.3.2",
"FixedVersion": "2.9.1-6.amzn2.3.3",
"Title": "libxml2: Use after free via namespace node in XPointer ranges",
"Description": "xpointer.c in libxml2 before 2.9.5 (as used in Apple iOS before 10, OS X before 10.12, tvOS before 10, and watchOS before 3, and other products) does not forbid namespace nodes in XPointer ranges, which allows remote attackers to execute arbitrary code or cause a denial of service (use-after-free and memory corruption) via a crafted XML document.",
"Severity": "CRITICAL",
"References": [
"http://lists.apple.com/archives/security-announce/2016/Sep/msg00006.html",
"http://lists.apple.com/archives/security-announce/2016/Sep/msg00008.html",
"http://lists.apple.com/archives/security-announce/2016/Sep/msg00010.html",
"http://lists.apple.com/archives/security-announce/2016/Sep/msg00011.html",
"http://www.securityfocus.com/bid/93054",
"http://www.securitytracker.com/id/1036858",
"http://www.securitytracker.com/id/1038623",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-4658",
"https://git.gnome.org/browse/libxml2/commit/?id=c1d1f7121194036608bf555f08d3062a36fd344b",
"https://github.com/sparklemotion/nokogiri/issues/1615",
"https://security.gentoo.org/glsa/201701-37",
"https://support.apple.com/HT207141",
"https://support.apple.com/HT207142",
"https://support.apple.com/HT207143",
"https://support.apple.com/HT207170"
]
},
{
"VulnerabilityID": "CVE-2017-16931",
"PkgName": "libxml2",
"InstalledVersion": "2.9.1-6.amzn2.3.2",
"FixedVersion": "2.9.1-6.amzn2.3.3",
"Title": "libxml2: Mishandling parameter-entity references",
"Description": "parser.c in libxml2 before 2.9.5 mishandles parameter-entity references because the NEXTL macro calls the xmlParserHandlePEReference function in the case of a '%' character in a DTD name.",
"Severity": "HIGH",
"References": [
"http://xmlsoft.org/news.html",
"https://bugzilla.gnome.org/show_bug.cgi?id=766956",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16931",
"https://github.com/GNOME/libxml2/commit/e26630548e7d138d2c560844c43820b6767251e3",
"https://lists.debian.org/debian-lts-announce/2017/11/msg00041.html"
]
},
{
"VulnerabilityID": "CVE-2017-10684",
"PkgName": "ncurses",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Stack-based buffer overflow in fmt_entry function in dump_entry.c",
"Description": "In ncurses 6.0, there is a stack-based buffer overflow in the fmt_entry function. A crafted input will lead to a remote arbitrary code execution attack.",
"Severity": "HIGH",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464687",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10684",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-10685",
"PkgName": "ncurses",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Stack-based buffer overflow caused by format string vulnerability in fmt_entry function",
"Description": "In ncurses 6.0, there is a format string vulnerability in the fmt_entry function. A crafted input will lead to a remote arbitrary code execution attack.",
"Severity": "HIGH",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464692",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10685",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-11112",
"PkgName": "ncurses",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Illegal address access in append_acs function",
"Description": "In ncurses 6.0, there is an attempted 0xffffffffffffffff access in the append_acs function of tinfo/parse_entry.c. It could lead to a remote denial of service attack if the terminfo library code is used to process untrusted terminfo data.",
"Severity": "MEDIUM",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464686",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11112",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-11113",
"PkgName": "ncurses",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Null pointer dereference vulnerability in _nc_parse_entry function",
"Description": "In ncurses 6.0, there is a NULL Pointer Dereference in the _nc_parse_entry function of tinfo/parse_entry.c. It could lead to a remote denial of service attack if the terminfo library code is used to process untrusted terminfo data.",
"Severity": "MEDIUM",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464691",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11113",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-10684",
"PkgName": "ncurses-base",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Stack-based buffer overflow in fmt_entry function in dump_entry.c",
"Description": "In ncurses 6.0, there is a stack-based buffer overflow in the fmt_entry function. A crafted input will lead to a remote arbitrary code execution attack.",
"Severity": "HIGH",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464687",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10684",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-10685",
"PkgName": "ncurses-base",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Stack-based buffer overflow caused by format string vulnerability in fmt_entry function",
"Description": "In ncurses 6.0, there is a format string vulnerability in the fmt_entry function. A crafted input will lead to a remote arbitrary code execution attack.",
"Severity": "HIGH",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464692",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10685",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-11112",
"PkgName": "ncurses-base",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Illegal address access in append_acs function",
"Description": "In ncurses 6.0, there is an attempted 0xffffffffffffffff access in the append_acs function of tinfo/parse_entry.c. It could lead to a remote denial of service attack if the terminfo library code is used to process untrusted terminfo data.",
"Severity": "MEDIUM",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464686",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11112",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-11113",
"PkgName": "ncurses-base",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Null pointer dereference vulnerability in _nc_parse_entry function",
"Description": "In ncurses 6.0, there is a NULL Pointer Dereference in the _nc_parse_entry function of tinfo/parse_entry.c. It could lead to a remote denial of service attack if the terminfo library code is used to process untrusted terminfo data.",
"Severity": "MEDIUM",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464691",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11113",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-10684",
"PkgName": "ncurses-libs",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Stack-based buffer overflow in fmt_entry function in dump_entry.c",
"Description": "In ncurses 6.0, there is a stack-based buffer overflow in the fmt_entry function. A crafted input will lead to a remote arbitrary code execution attack.",
"Severity": "HIGH",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464687",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10684",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-10685",
"PkgName": "ncurses-libs",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Stack-based buffer overflow caused by format string vulnerability in fmt_entry function",
"Description": "In ncurses 6.0, there is a format string vulnerability in the fmt_entry function. A crafted input will lead to a remote arbitrary code execution attack.",
"Severity": "HIGH",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464692",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10685",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-11112",
"PkgName": "ncurses-libs",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Illegal address access in append_acs function",
"Description": "In ncurses 6.0, there is an attempted 0xffffffffffffffff access in the append_acs function of tinfo/parse_entry.c. It could lead to a remote denial of service attack if the terminfo library code is used to process untrusted terminfo data.",
"Severity": "MEDIUM",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464686",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11112",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2017-11113",
"PkgName": "ncurses-libs",
"InstalledVersion": "6.0-8.20170212.amzn2.1.2",
"FixedVersion": "6.0-8.20170212.amzn2.1.3",
"Title": "ncurses: Null pointer dereference vulnerability in _nc_parse_entry function",
"Description": "In ncurses 6.0, there is a NULL Pointer Dereference in the _nc_parse_entry function of tinfo/parse_entry.c. It could lead to a remote denial of service attack if the terminfo library code is used to process untrusted terminfo data.",
"Severity": "MEDIUM",
"References": [
"https://bugzilla.redhat.com/show_bug.cgi?id=1464691",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11113",
"https://security.gentoo.org/glsa/201804-13"
]
},
{
"VulnerabilityID": "CVE-2018-12404",
"PkgName": "nss",
"InstalledVersion": "3.36.0-7.amzn2",
"FixedVersion": "3.44.0-4.amzn2.0.2",
"Title": "nss: Cache side-channel variant of the Bleichenbacher attack",
"Description": "A cached side channel attack during handshakes using RSA encryption could allow for the decryption of encrypted content. This is a variant of the Adaptive Chosen Ciphertext attack (AKA Bleichenbacher attack) and affects all NSS versions prior to NSS 3.41.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00021.html",
"http://www.securityfocus.com/bid/107260",
"https://bugzilla.mozilla.org/show_bug.cgi?id=CVE-2018-12404",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-12404"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nss",
"InstalledVersion": "3.36.0-7.amzn2",
"FixedVersion": "3.44.0-4.amzn2.0.2",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-12404",
"PkgName": "nss-sysinit",
"InstalledVersion": "3.36.0-7.amzn2",
"FixedVersion": "3.44.0-4.amzn2.0.2",
"Title": "nss: Cache side-channel variant of the Bleichenbacher attack",
"Description": "A cached side channel attack during handshakes using RSA encryption could allow for the decryption of encrypted content. This is a variant of the Adaptive Chosen Ciphertext attack (AKA Bleichenbacher attack) and affects all NSS versions prior to NSS 3.41.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00021.html",
"http://www.securityfocus.com/bid/107260",
"https://bugzilla.mozilla.org/show_bug.cgi?id=CVE-2018-12404",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-12404"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nss-sysinit",
"InstalledVersion": "3.36.0-7.amzn2",
"FixedVersion": "3.44.0-4.amzn2.0.2",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-12404",
"PkgName": "nss-tools",
"InstalledVersion": "3.36.0-7.amzn2",
"FixedVersion": "3.44.0-4.amzn2.0.2",
"Title": "nss: Cache side-channel variant of the Bleichenbacher attack",
"Description": "A cached side channel attack during handshakes using RSA encryption could allow for the decryption of encrypted content. This is a variant of the Adaptive Chosen Ciphertext attack (AKA Bleichenbacher attack) and affects all NSS versions prior to NSS 3.41.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00021.html",
"http://www.securityfocus.com/bid/107260",
"https://bugzilla.mozilla.org/show_bug.cgi?id=CVE-2018-12404",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-12404"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nss-tools",
"InstalledVersion": "3.36.0-7.amzn2",
"FixedVersion": "3.44.0-4.amzn2.0.2",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2019-5010",
"PkgName": "python",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: NULL pointer dereference using a specially crafted X509 certificate",
"Description": "A null pointer dereference vulnerability was found in the certificate parsing code in Python. This causes a denial of service to applications when parsing specially crafted certificates. This vulnerability is unlikely to be triggered if application enables SSL/TLS certificate validation and accepts certificates only from trusted root certificate authorities.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5010",
"https://python-security.readthedocs.io/vuln/ssl-crl-dps-dos.html"
]
},
{
"VulnerabilityID": "CVE-2018-1060",
"PkgName": "python",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: DOS via regular expression catastrophic backtracking in apop() method in pop3lib",
"Description": "python before versions 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1 and 3.7.0 is vulnerable to catastrophic backtracking in pop3lib's apop() method. An attacker could use this flaw to cause denial of service.",
"Severity": "MEDIUM",
"References": [
"http://www.securitytracker.com/id/1042001",
"https://access.redhat.com/errata/RHBA-2019:0327",
"https://access.redhat.com/errata/RHSA-2018:3041",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1260",
"https://bugs.python.org/issue32981",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-1060",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1060",
"https://docs.python.org/3.5/whatsnew/changelog.html#python-3-5-6-release-candidate-1",
"https://docs.python.org/3.6/whatsnew/changelog.html#python-3-6-5-final",
"https://docs.python.org/3.6/whatsnew/changelog.html#python-3-6-5-release-candidate-1",
"https://lists.debian.org/debian-lts-announce/2018/09/msg00030.html",
"https://lists.debian.org/debian-lts-announce/2018/09/msg00031.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/46PVWY5LFP4BRPG3BVQ5QEEFYBVEXHCK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AEZ5IQT7OF7Q2NCGIVABOWYGKO7YU3NJ/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JSKPGPZQNTAULHW4UH63KGOOUIDE4RRB/",
"https://support.hpe.com/hpsc/doc/public/display?docLocale=en_US\u0026docId=emr_na-hpesbst03951en_us",
"https://usn.ubuntu.com/3817-1/",
"https://usn.ubuntu.com/3817-2/",
"https://www.debian.org/security/2018/dsa-4306",
"https://www.debian.org/security/2018/dsa-4307"
]
},
{
"VulnerabilityID": "CVE-2018-1061",
"PkgName": "python",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: DOS via regular expression backtracking in difflib.IS_LINE_JUNK method in difflib",
"Description": "python before versions 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1 and 3.7.0 is vulnerable to catastrophic backtracking in the difflib.IS_LINE_JUNK method. An attacker could use this flaw to cause denial of service.",
"Severity": "MEDIUM",
"References": [
"http://www.securitytracker.com/id/1042001",
"https://access.redhat.com/errata/RHBA-2019:0327",
"https://access.redhat.com/errata/RHSA-2018:3041",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1260",
"https://bugs.python.org/issue32981",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-1061",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1061",
"https://docs.python.org/3.5/whatsnew/changelog.html#python-3-5-6-release-candidate-1",
"https://docs.python.org/3.6/whatsnew/changelog.html#python-3-6-5-final",
"https://docs.python.org/3.6/whatsnew/changelog.html#python-3-6-5-release-candidate-1",
"https://lists.debian.org/debian-lts-announce/2018/09/msg00030.html",
"https://lists.debian.org/debian-lts-announce/2018/09/msg00031.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/46PVWY5LFP4BRPG3BVQ5QEEFYBVEXHCK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AEZ5IQT7OF7Q2NCGIVABOWYGKO7YU3NJ/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JSKPGPZQNTAULHW4UH63KGOOUIDE4RRB/",
"https://support.hpe.com/hpsc/doc/public/display?docLocale=en_US\u0026docId=emr_na-hpesbst03951en_us",
"https://usn.ubuntu.com/3817-1/",
"https://usn.ubuntu.com/3817-2/",
"https://www.debian.org/security/2018/dsa-4306",
"https://www.debian.org/security/2018/dsa-4307"
]
},
{
"VulnerabilityID": "CVE-2018-20406",
"PkgName": "python",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: Integer overflow in Modules/_pickle.c allows for memory exhaustion if serializing gigabytes of data",
"Description": "Modules/_pickle.c in Python before 3.7.1 has an integer overflow via a large LONG_BINPUT value that is mishandled during a \"resize to twice the size\" attempt. This issue might cause memory exhaustion, but is only relevant if the pickle format is used for serializing tens or hundreds of gigabytes of data.",
"Severity": "MEDIUM",
"References": [
"https://bugs.python.org/issue34656",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20406",
"https://github.com/python/cpython/commit/a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd",
"https://lists.debian.org/debian-lts-announce/2019/02/msg00011.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/46PVWY5LFP4BRPG3BVQ5QEEFYBVEXHCK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AEZ5IQT7OF7Q2NCGIVABOWYGKO7YU3NJ/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/D3LXPABKVLFYUHRYJPM3CSS5MS6FXKS7/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ICBEGRHIPHWPG2VGYS6R4EVKVUUF4AQW/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JSKPGPZQNTAULHW4UH63KGOOUIDE4RRB/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TR6GCO3WTV4D5L23WTCBF275VE6BVNI3/",
"https://python-security.readthedocs.io/vuln/pickle-load-dos.html",
"https://security.netapp.com/advisory/ntap-20190416-0010/"
]
},
{
"VulnerabilityID": "CVE-2019-10160",
"PkgName": "python",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-2.amzn2.0.1",
"Title": "python: regression of CVE-2019-9636 due to functional fix to allow port numbers in netloc",
"Description": "A security regression of CVE-2019-9636 was discovered in python since commit d537ab0ff9767ef024f26246899728f0116b1ec3 affecting versions 2.7, 3.5, 3.6, 3.7 and from v3.8.0a4 through v3.8.0b1, which still allows an attacker to exploit CVE-2019-9636 by abusing the user and password parts of a URL. When an application parses user-supplied URLs to store cookies, authentication credentials, or other kind of information, it is possible for an attacker to provide specially crafted URLs to make the application locate host-related information (e.g. cookies, authentication data) and send them to a different host than where it should, unlike if the URLs had been correctly parsed. The result of an attack may vary based on the application.",
"Severity": "MEDIUM",
"References": [
"https://access.redhat.com/errata/RHSA-2019:1587",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-10160",
"https://github.com/python/cpython/commit/250b62acc59921d399f0db47db3b462cd6037e09",
"https://github.com/python/cpython/commit/8d0ef0b5edeae52960c7ed05ae8a12388324f87e",
"https://github.com/python/cpython/commit/f61599b050c621386a3fc6bc480359e2d3bb93de",
"https://github.com/python/cpython/commit/fd1771dbdd28709716bd531580c40ae5ed814468",
"https://lists.debian.org/debian-lts-announce/2019/06/msg00022.html",
"https://python-security.readthedocs.io/vuln/urlsplit-nfkc-normalization2.html",
"https://security.netapp.com/advisory/ntap-20190617-0003/"
]
},
{
"VulnerabilityID": "CVE-2019-9636",
"PkgName": "python",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: Information Disclosure due to urlsplit improper NFKC normalization",
"Description": "Python 2.7.x through 2.7.16 and 3.x through 3.7.2 is affected by: Improper Handling of Unicode Encoding (with an incorrect netloc) during NFKC normalization. The impact is: Information disclosure (credentials, cookies, etc. that are cached against a given hostname). The components are: urllib.parse.urlsplit, urllib.parse.urlparse. The attack vector is: A specially crafted URL could be incorrectly parsed to locate cookies or authentication data and send that information to a different host than when parsed correctly.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00092.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00097.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00024.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00050.html",
"http://www.securityfocus.com/bid/107400",
"https://access.redhat.com/errata/RHBA-2019:0959",
"https://access.redhat.com/errata/RHSA-2019:0710",
"https://access.redhat.com/errata/RHSA-2019:0765",
"https://access.redhat.com/errata/RHSA-2019:0806",
"https://access.redhat.com/errata/RHSA-2019:0902",
"https://access.redhat.com/errata/RHSA-2019:0981",
"https://access.redhat.com/errata/RHSA-2019:0997",
"https://access.redhat.com/errata/RHSA-2019:1467",
"https://bugs.python.org/issue36216",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9636",
"https://github.com/python/cpython/pull/12201",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/46PVWY5LFP4BRPG3BVQ5QEEFYBVEXHCK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AEZ5IQT7OF7Q2NCGIVABOWYGKO7YU3NJ/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CFBAAGM27H73OLYBUA2IAZFSUN6KGLME/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/D3LXPABKVLFYUHRYJPM3CSS5MS6FXKS7/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ICBEGRHIPHWPG2VGYS6R4EVKVUUF4AQW/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IFAXBEY2TGOBDRKTR556JBXBVFSAKD6I/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JMWSKTNOHSUOT3L25QFJAVCFYZX46FYK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JSKPGPZQNTAULHW4UH63KGOOUIDE4RRB/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JXASHCDD4PQFKTMKQN4YOP5ZH366ABN4/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/L25RTMKCF62DLC2XVSNXGX7C7HXISLVM/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TR6GCO3WTV4D5L23WTCBF275VE6BVNI3/",
"https://python-security.readthedocs.io/vuln/urlsplit-nfkc-normalization.html",
"https://security.netapp.com/advisory/ntap-20190517-0001/"
]
},
{
"VulnerabilityID": "CVE-2019-9948",
"PkgName": "python",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-3.amzn2.0.1",
"Title": "python: Undocumented local_file protocol allows remote attackers to bypass protection mechanisms",
"Description": "urllib in Python 2.x through 2.7.16 supports the local_file: scheme, which makes it easier for remote attackers to bypass protection mechanisms that blacklist file: URIs, as demonstrated by triggering a urllib.urlopen('local_file:///etc/passwd') call.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00092.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00050.html",
"http://www.securityfocus.com/bid/107549",
"https://bugs.python.org/issue35907",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9948",
"https://github.com/python/cpython/pull/11842",
"https://lists.debian.org/debian-lts-announce/2019/06/msg00022.html",
"https://security.netapp.com/advisory/ntap-20190404-0004/"
]
},
{
"VulnerabilityID": "CVE-2019-5010",
"PkgName": "python-libs",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: NULL pointer dereference using a specially crafted X509 certificate",
"Description": "A null pointer dereference vulnerability was found in the certificate parsing code in Python. This causes a denial of service to applications when parsing specially crafted certificates. This vulnerability is unlikely to be triggered if application enables SSL/TLS certificate validation and accepts certificates only from trusted root certificate authorities.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5010",
"https://python-security.readthedocs.io/vuln/ssl-crl-dps-dos.html"
]
},
{
"VulnerabilityID": "CVE-2018-1060",
"PkgName": "python-libs",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: DOS via regular expression catastrophic backtracking in apop() method in pop3lib",
"Description": "python before versions 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1 and 3.7.0 is vulnerable to catastrophic backtracking in pop3lib's apop() method. An attacker could use this flaw to cause denial of service.",
"Severity": "MEDIUM",
"References": [
"http://www.securitytracker.com/id/1042001",
"https://access.redhat.com/errata/RHBA-2019:0327",
"https://access.redhat.com/errata/RHSA-2018:3041",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1260",
"https://bugs.python.org/issue32981",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-1060",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1060",
"https://docs.python.org/3.5/whatsnew/changelog.html#python-3-5-6-release-candidate-1",
"https://docs.python.org/3.6/whatsnew/changelog.html#python-3-6-5-final",
"https://docs.python.org/3.6/whatsnew/changelog.html#python-3-6-5-release-candidate-1",
"https://lists.debian.org/debian-lts-announce/2018/09/msg00030.html",
"https://lists.debian.org/debian-lts-announce/2018/09/msg00031.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/46PVWY5LFP4BRPG3BVQ5QEEFYBVEXHCK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AEZ5IQT7OF7Q2NCGIVABOWYGKO7YU3NJ/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JSKPGPZQNTAULHW4UH63KGOOUIDE4RRB/",
"https://support.hpe.com/hpsc/doc/public/display?docLocale=en_US\u0026docId=emr_na-hpesbst03951en_us",
"https://usn.ubuntu.com/3817-1/",
"https://usn.ubuntu.com/3817-2/",
"https://www.debian.org/security/2018/dsa-4306",
"https://www.debian.org/security/2018/dsa-4307"
]
},
{
"VulnerabilityID": "CVE-2018-1061",
"PkgName": "python-libs",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: DOS via regular expression backtracking in difflib.IS_LINE_JUNK method in difflib",
"Description": "python before versions 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1 and 3.7.0 is vulnerable to catastrophic backtracking in the difflib.IS_LINE_JUNK method. An attacker could use this flaw to cause denial of service.",
"Severity": "MEDIUM",
"References": [
"http://www.securitytracker.com/id/1042001",
"https://access.redhat.com/errata/RHBA-2019:0327",
"https://access.redhat.com/errata/RHSA-2018:3041",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1260",
"https://bugs.python.org/issue32981",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-1061",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1061",
"https://docs.python.org/3.5/whatsnew/changelog.html#python-3-5-6-release-candidate-1",
"https://docs.python.org/3.6/whatsnew/changelog.html#python-3-6-5-final",
"https://docs.python.org/3.6/whatsnew/changelog.html#python-3-6-5-release-candidate-1",
"https://lists.debian.org/debian-lts-announce/2018/09/msg00030.html",
"https://lists.debian.org/debian-lts-announce/2018/09/msg00031.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/46PVWY5LFP4BRPG3BVQ5QEEFYBVEXHCK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AEZ5IQT7OF7Q2NCGIVABOWYGKO7YU3NJ/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JSKPGPZQNTAULHW4UH63KGOOUIDE4RRB/",
"https://support.hpe.com/hpsc/doc/public/display?docLocale=en_US\u0026docId=emr_na-hpesbst03951en_us",
"https://usn.ubuntu.com/3817-1/",
"https://usn.ubuntu.com/3817-2/",
"https://www.debian.org/security/2018/dsa-4306",
"https://www.debian.org/security/2018/dsa-4307"
]
},
{
"VulnerabilityID": "CVE-2018-20406",
"PkgName": "python-libs",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: Integer overflow in Modules/_pickle.c allows for memory exhaustion if serializing gigabytes of data",
"Description": "Modules/_pickle.c in Python before 3.7.1 has an integer overflow via a large LONG_BINPUT value that is mishandled during a \"resize to twice the size\" attempt. This issue might cause memory exhaustion, but is only relevant if the pickle format is used for serializing tens or hundreds of gigabytes of data.",
"Severity": "MEDIUM",
"References": [
"https://bugs.python.org/issue34656",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20406",
"https://github.com/python/cpython/commit/a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd",
"https://lists.debian.org/debian-lts-announce/2019/02/msg00011.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/46PVWY5LFP4BRPG3BVQ5QEEFYBVEXHCK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AEZ5IQT7OF7Q2NCGIVABOWYGKO7YU3NJ/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/D3LXPABKVLFYUHRYJPM3CSS5MS6FXKS7/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ICBEGRHIPHWPG2VGYS6R4EVKVUUF4AQW/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JSKPGPZQNTAULHW4UH63KGOOUIDE4RRB/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TR6GCO3WTV4D5L23WTCBF275VE6BVNI3/",
"https://python-security.readthedocs.io/vuln/pickle-load-dos.html",
"https://security.netapp.com/advisory/ntap-20190416-0010/"
]
},
{
"VulnerabilityID": "CVE-2019-10160",
"PkgName": "python-libs",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-2.amzn2.0.1",
"Title": "python: regression of CVE-2019-9636 due to functional fix to allow port numbers in netloc",
"Description": "A security regression of CVE-2019-9636 was discovered in python since commit d537ab0ff9767ef024f26246899728f0116b1ec3 affecting versions 2.7, 3.5, 3.6, 3.7 and from v3.8.0a4 through v3.8.0b1, which still allows an attacker to exploit CVE-2019-9636 by abusing the user and password parts of a URL. When an application parses user-supplied URLs to store cookies, authentication credentials, or other kind of information, it is possible for an attacker to provide specially crafted URLs to make the application locate host-related information (e.g. cookies, authentication data) and send them to a different host than where it should, unlike if the URLs had been correctly parsed. The result of an attack may vary based on the application.",
"Severity": "MEDIUM",
"References": [
"https://access.redhat.com/errata/RHSA-2019:1587",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-10160",
"https://github.com/python/cpython/commit/250b62acc59921d399f0db47db3b462cd6037e09",
"https://github.com/python/cpython/commit/8d0ef0b5edeae52960c7ed05ae8a12388324f87e",
"https://github.com/python/cpython/commit/f61599b050c621386a3fc6bc480359e2d3bb93de",
"https://github.com/python/cpython/commit/fd1771dbdd28709716bd531580c40ae5ed814468",
"https://lists.debian.org/debian-lts-announce/2019/06/msg00022.html",
"https://python-security.readthedocs.io/vuln/urlsplit-nfkc-normalization2.html",
"https://security.netapp.com/advisory/ntap-20190617-0003/"
]
},
{
"VulnerabilityID": "CVE-2019-9636",
"PkgName": "python-libs",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-1.amzn2.0.1",
"Title": "python: Information Disclosure due to urlsplit improper NFKC normalization",
"Description": "Python 2.7.x through 2.7.16 and 3.x through 3.7.2 is affected by: Improper Handling of Unicode Encoding (with an incorrect netloc) during NFKC normalization. The impact is: Information disclosure (credentials, cookies, etc. that are cached against a given hostname). The components are: urllib.parse.urlsplit, urllib.parse.urlparse. The attack vector is: A specially crafted URL could be incorrectly parsed to locate cookies or authentication data and send that information to a different host than when parsed correctly.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00092.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00097.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00024.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00050.html",
"http://www.securityfocus.com/bid/107400",
"https://access.redhat.com/errata/RHBA-2019:0959",
"https://access.redhat.com/errata/RHSA-2019:0710",
"https://access.redhat.com/errata/RHSA-2019:0765",
"https://access.redhat.com/errata/RHSA-2019:0806",
"https://access.redhat.com/errata/RHSA-2019:0902",
"https://access.redhat.com/errata/RHSA-2019:0981",
"https://access.redhat.com/errata/RHSA-2019:0997",
"https://access.redhat.com/errata/RHSA-2019:1467",
"https://bugs.python.org/issue36216",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9636",
"https://github.com/python/cpython/pull/12201",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/46PVWY5LFP4BRPG3BVQ5QEEFYBVEXHCK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AEZ5IQT7OF7Q2NCGIVABOWYGKO7YU3NJ/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CFBAAGM27H73OLYBUA2IAZFSUN6KGLME/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/D3LXPABKVLFYUHRYJPM3CSS5MS6FXKS7/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ICBEGRHIPHWPG2VGYS6R4EVKVUUF4AQW/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IFAXBEY2TGOBDRKTR556JBXBVFSAKD6I/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JMWSKTNOHSUOT3L25QFJAVCFYZX46FYK/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JSKPGPZQNTAULHW4UH63KGOOUIDE4RRB/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JXASHCDD4PQFKTMKQN4YOP5ZH366ABN4/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/L25RTMKCF62DLC2XVSNXGX7C7HXISLVM/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TR6GCO3WTV4D5L23WTCBF275VE6BVNI3/",
"https://python-security.readthedocs.io/vuln/urlsplit-nfkc-normalization.html",
"https://security.netapp.com/advisory/ntap-20190517-0001/"
]
},
{
"VulnerabilityID": "CVE-2019-9948",
"PkgName": "python-libs",
"InstalledVersion": "2.7.14-58.amzn2.0.4",
"FixedVersion": "2.7.16-3.amzn2.0.1",
"Title": "python: Undocumented local_file protocol allows remote attackers to bypass protection mechanisms",
"Description": "urllib in Python 2.x through 2.7.16 supports the local_file: scheme, which makes it easier for remote attackers to bypass protection mechanisms that blacklist file: URIs, as demonstrated by triggering a urllib.urlopen('local_file:///etc/passwd') call.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00092.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00050.html",
"http://www.securityfocus.com/bid/107549",
"https://bugs.python.org/issue35907",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9948",
"https://github.com/python/cpython/pull/11842",
"https://lists.debian.org/debian-lts-announce/2019/06/msg00022.html",
"https://security.netapp.com/advisory/ntap-20190404-0004/"
]
},
{
"VulnerabilityID": "CVE-2019-12735",
"PkgName": "vim-minimal",
"InstalledVersion": "2:7.4.160-4.amzn2.0.16",
"FixedVersion": "2:8.1.1602-1.amzn2",
"Title": "vim/neovim: ':source!' command allows arbitrary command execution via modelines",
"Description": "getchar.c in Vim before 8.1.1365 and Neovim before 0.3.6 allows remote attackers to execute arbitrary OS commands via the :source! command in a modeline, as demonstrated by execute in Vim, and assert_fails or nvim_input in Neovim.",
"Severity": "CRITICAL",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00031.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00036.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00037.html",
"http://www.securityfocus.com/bid/108724",
"https://bugs.debian.org/930020",
"https://bugs.debian.org/930024",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12735",
"https://github.com/neovim/neovim/pull/10082",
"https://github.com/numirias/security/blob/master/doc/2019-06-04_ace-vim-neovim.md",
"https://github.com/vim/vim/commit/53575521406739cf20bbe4e384d88e7dca11f040",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2BMDSHTF754TITC6AQJPCS5IRIDMMIM7/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TRIRBC2YRGKPAWVRMZS4SZTGGCVRVZPR/",
"https://usn.ubuntu.com/4016-1/",
"https://usn.ubuntu.com/4016-2/",
"https://www.debian.org/security/2019/dsa-4467"
]
}
]
}
]

12723
integration/testdata/centos-6.json.golden vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,118 @@
[
{
"Target": "testdata/fixtures/centos-7.tar.gz (centos 7.6.1810)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2018-14618",
"PkgName": "curl",
"InstalledVersion": "7.29.0-51.el7",
"FixedVersion": "7.29.0-51.el7_6.3",
"Title": "curl: NTLM password overflow via integer overflow",
"Description": "curl before version 7.61.1 is vulnerable to a buffer overrun in the NTLM authentication code. The internal function Curl_ntlm_core_mk_nt_hash multiplies the length of the password by two (SUM) to figure out how large temporary storage area to allocate from the heap. The length value is then subsequently used to iterate over the password and generate output into the allocated storage buffer. On systems with a 32 bit size_t, the math to calculate SUM triggers an integer overflow when the password length exceeds 2GB (2^31 bytes). This integer overflow usually causes a very small buffer to actually get allocated instead of the intended very huge one, making the use of that buffer end up in a heap buffer overflow. (This bug is almost identical to CVE-2017-8816.)",
"Severity": "CRITICAL",
"References": [
"http://www.securitytracker.com/id/1041605",
"https://access.redhat.com/errata/RHSA-2018:3558",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-14618",
"https://cert-portal.siemens.com/productcert/pdf/ssa-436177.pdf",
"https://curl.haxx.se/docs/CVE-2018-14618.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-14618",
"https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2018-0014",
"https://security.gentoo.org/glsa/201903-03",
"https://usn.ubuntu.com/3765-1/",
"https://usn.ubuntu.com/3765-2/",
"https://www.debian.org/security/2018/dsa-4286"
]
},
{
"VulnerabilityID": "CVE-2018-14618",
"PkgName": "libcurl",
"InstalledVersion": "7.29.0-51.el7",
"FixedVersion": "7.29.0-51.el7_6.3",
"Title": "curl: NTLM password overflow via integer overflow",
"Description": "curl before version 7.61.1 is vulnerable to a buffer overrun in the NTLM authentication code. The internal function Curl_ntlm_core_mk_nt_hash multiplies the length of the password by two (SUM) to figure out how large temporary storage area to allocate from the heap. The length value is then subsequently used to iterate over the password and generate output into the allocated storage buffer. On systems with a 32 bit size_t, the math to calculate SUM triggers an integer overflow when the password length exceeds 2GB (2^31 bytes). This integer overflow usually causes a very small buffer to actually get allocated instead of the intended very huge one, making the use of that buffer end up in a heap buffer overflow. (This bug is almost identical to CVE-2017-8816.)",
"Severity": "CRITICAL",
"References": [
"http://www.securitytracker.com/id/1041605",
"https://access.redhat.com/errata/RHSA-2018:3558",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-14618",
"https://cert-portal.siemens.com/productcert/pdf/ssa-436177.pdf",
"https://curl.haxx.se/docs/CVE-2018-14618.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-14618",
"https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2018-0014",
"https://security.gentoo.org/glsa/201903-03",
"https://usn.ubuntu.com/3765-1/",
"https://usn.ubuntu.com/3765-2/",
"https://www.debian.org/security/2018/dsa-4286"
]
},
{
"VulnerabilityID": "CVE-2019-3855",
"PkgName": "libssh2",
"InstalledVersion": "1.4.3-12.el7",
"FixedVersion": "1.4.3-12.el7_6.2",
"Title": "libssh2: Integer overflow in transport read resulting in out of bounds write",
"Description": "An integer overflow flaw which could lead to an out of bounds write was discovered in libssh2 before 1.8.1 in the way packets are read from the server. A remote attacker who compromises a SSH server may be able to execute code on the client system when a user connects to the server.",
"Severity": "CRITICAL",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-03/msg00040.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00003.html",
"http://packetstormsecurity.com/files/152136/Slackware-Security-Advisory-libssh2-Updates.html",
"http://www.openwall.com/lists/oss-security/2019/03/18/3",
"http://www.securityfocus.com/bid/107485",
"https://access.redhat.com/errata/RHSA-2019:0679",
"https://access.redhat.com/errata/RHSA-2019:1175",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3855",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3855",
"https://lists.debian.org/debian-lts-announce/2019/03/msg00032.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5DK6VO2CEUTAJFYIKWNZKEKYMYR3NO2O/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XCWEA5ZCLKRDUK62QVVYMFWLWKOPX3LO/",
"https://seclists.org/bugtraq/2019/Apr/25",
"https://seclists.org/bugtraq/2019/Mar/25",
"https://security.netapp.com/advisory/ntap-20190327-0005/",
"https://www.broadcom.com/support/fibre-channel-networking/security-advisories/brocade-security-advisory-2019-767",
"https://www.debian.org/security/2019/dsa-4431",
"https://www.libssh2.org/CVE-2019-3855.html"
]
},
{
"VulnerabilityID": "CVE-2018-15686",
"PkgName": "systemd",
"InstalledVersion": "219-62.el7_6.5",
"FixedVersion": "219-67.el7",
"Title": "systemd: line splitting via fgets() allows for state injection during daemon-reexec",
"Description": "A vulnerability in unit_deserialize of systemd allows an attacker to supply arbitrary state across systemd re-execution via NotifyAccess. This can be used to improperly influence systemd execution and possibly lead to root privilege escalation. Affected releases are systemd versions up to and including 239.",
"Severity": "CRITICAL",
"References": [
"http://www.securityfocus.com/bid/105747",
"https://access.redhat.com/errata/RHSA-2019:2091",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-15686",
"https://github.com/systemd/systemd/pull/10519",
"https://lists.debian.org/debian-lts-announce/2018/11/msg00017.html",
"https://security.gentoo.org/glsa/201810-10",
"https://usn.ubuntu.com/3816-1/",
"https://www.exploit-db.com/exploits/45714/"
]
},
{
"VulnerabilityID": "CVE-2018-15686",
"PkgName": "systemd-libs",
"InstalledVersion": "219-62.el7_6.5",
"FixedVersion": "219-67.el7",
"Title": "systemd: line splitting via fgets() allows for state injection during daemon-reexec",
"Description": "A vulnerability in unit_deserialize of systemd allows an attacker to supply arbitrary state across systemd re-execution via NotifyAccess. This can be used to improperly influence systemd execution and possibly lead to root privilege escalation. Affected releases are systemd versions up to and including 239.",
"Severity": "CRITICAL",
"References": [
"http://www.securityfocus.com/bid/105747",
"https://access.redhat.com/errata/RHSA-2019:2091",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-15686",
"https://github.com/systemd/systemd/pull/10519",
"https://lists.debian.org/debian-lts-announce/2018/11/msg00017.html",
"https://security.gentoo.org/glsa/201810-10",
"https://usn.ubuntu.com/3816-1/",
"https://www.exploit-db.com/exploits/45714/"
]
}
]
}
]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,415 @@
[
{
"Target": "testdata/fixtures/centos-7.tar.gz (centos 7.6.1810)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2018-5743",
"PkgName": "bind-license",
"InstalledVersion": "32:9.9.4-73.el7_6",
"FixedVersion": "32:9.9.4-74.el7_6.1",
"Title": "bind: Limiting simultaneous TCP clients is ineffective",
"Description": "By design, BIND is intended to limit the number of TCP clients that can be connected at any given time. The number of allowed connections is a tunable parameter which, if unset, defaults to a conservative value for most servers. Unfortunately, the code which was intended to limit the number of simultaneous connections contained an error which could be exploited to grow the number of simultaneous connections beyond this limit. Versions affected: BIND 9.9.0 -\u003e 9.10.8-P1, 9.11.0 -\u003e 9.11.6, 9.12.0 -\u003e 9.12.4, 9.14.0. BIND 9 Supported Preview Edition versions 9.9.3-S1 -\u003e 9.11.5-S3, and 9.11.5-S5. Versions 9.13.0 -\u003e 9.13.7 of the 9.13 development branch are also affected. Versions prior to BIND 9.9.0 have not been evaluated for vulnerability to CVE-2018-5743.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-5743",
"https://kb.isc.org/docs/cve-2018-5743"
]
},
{
"VulnerabilityID": "CVE-2018-16402",
"PkgName": "elfutils-default-yama-scope",
"InstalledVersion": "0.172-2.el7",
"FixedVersion": "0.176-2.el7",
"Title": "elfutils: Double-free due to double decompression of sections in crafted ELF causes crash",
"Description": "libelf/elf_end.c in elfutils 0.173 allows remote attackers to cause a denial of service (double free and application crash) or possibly have unspecified other impact because it tries to decompress twice.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16402",
"https://sourceware.org/bugzilla/show_bug.cgi?id=23528",
"https://usn.ubuntu.com/4012-1/"
]
},
{
"VulnerabilityID": "CVE-2018-16402",
"PkgName": "elfutils-libelf",
"InstalledVersion": "0.172-2.el7",
"FixedVersion": "0.176-2.el7",
"Title": "elfutils: Double-free due to double decompression of sections in crafted ELF causes crash",
"Description": "libelf/elf_end.c in elfutils 0.173 allows remote attackers to cause a denial of service (double free and application crash) or possibly have unspecified other impact because it tries to decompress twice.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16402",
"https://sourceware.org/bugzilla/show_bug.cgi?id=23528",
"https://usn.ubuntu.com/4012-1/"
]
},
{
"VulnerabilityID": "CVE-2018-16402",
"PkgName": "elfutils-libs",
"InstalledVersion": "0.172-2.el7",
"FixedVersion": "0.176-2.el7",
"Title": "elfutils: Double-free due to double decompression of sections in crafted ELF causes crash",
"Description": "libelf/elf_end.c in elfutils 0.173 allows remote attackers to cause a denial of service (double free and application crash) or possibly have unspecified other impact because it tries to decompress twice.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16402",
"https://sourceware.org/bugzilla/show_bug.cgi?id=23528",
"https://usn.ubuntu.com/4012-1/"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nspr",
"InstalledVersion": "4.19.0-1.el7_5",
"FixedVersion": "4.21.0-1.el7",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nss",
"InstalledVersion": "3.36.0-7.1.el7_6",
"FixedVersion": "3.44.0-4.el7",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nss-softokn",
"InstalledVersion": "3.36.0-5.el7_5",
"FixedVersion": "3.44.0-5.el7",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nss-softokn-freebl",
"InstalledVersion": "3.36.0-5.el7_5",
"FixedVersion": "3.44.0-5.el7",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nss-sysinit",
"InstalledVersion": "3.36.0-7.1.el7_6",
"FixedVersion": "3.44.0-4.el7",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nss-tools",
"InstalledVersion": "3.36.0-7.1.el7_6",
"FixedVersion": "3.44.0-4.el7",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-0495",
"PkgName": "nss-util",
"InstalledVersion": "3.36.0-1.1.el7_6",
"FixedVersion": "3.44.0-3.el7",
"Title": "ROHNP: Key Extraction Side Channel in Multiple Crypto Libraries",
"Description": "Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be mitigated through the use of blinding during the signing process in the _gcry_ecc_ecdsa_sign function in cipher/ecc-ecdsa.c, aka the Return Of the Hidden Number Problem or ROHNP. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.",
"Severity": "LOW",
"References": [
"http://www.securitytracker.com/id/1041144",
"http://www.securitytracker.com/id/1041147",
"https://access.redhat.com/errata/RHSA-2018:3221",
"https://access.redhat.com/errata/RHSA-2018:3505",
"https://access.redhat.com/errata/RHSA-2019:1296",
"https://access.redhat.com/errata/RHSA-2019:1297",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0495",
"https://dev.gnupg.org/T4011",
"https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=9010d1576e278a4274ad3f4aa15776c28f6ba965",
"https://lists.debian.org/debian-lts-announce/2018/06/msg00013.html",
"https://lists.gnupg.org/pipermail/gnupg-announce/2018q2/000426.html",
"https://usn.ubuntu.com/3689-1/",
"https://usn.ubuntu.com/3689-2/",
"https://usn.ubuntu.com/3692-1/",
"https://usn.ubuntu.com/3692-2/",
"https://usn.ubuntu.com/3850-1/",
"https://usn.ubuntu.com/3850-2/",
"https://www.debian.org/security/2018/dsa-4231",
"https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-5407",
"PkgName": "openssl-libs",
"InstalledVersion": "1:1.0.2k-16.el7",
"FixedVersion": "1:1.0.2k-16.el7_6.1",
"Title": "openssl: Side-channel vulnerability on SMT/Hyper-Threading architectures (PortSmash)",
"Description": "Simultaneous Multi-threading (SMT) in processors can enable local users to exploit software vulnerable to timing attacks via a side-channel timing attack on 'port contention'.",
"Severity": "LOW",
"References": [
"http://www.securityfocus.com/bid/105897",
"https://access.redhat.com/errata/RHSA-2019:0483",
"https://access.redhat.com/errata/RHSA-2019:0651",
"https://access.redhat.com/errata/RHSA-2019:0652",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-5407",
"https://eprint.iacr.org/2018/1060.pdf",
"https://github.com/bbbrumley/portsmash",
"https://lists.debian.org/debian-lts-announce/2018/11/msg00024.html",
"https://nodejs.org/en/blog/vulnerability/november-2018-security-releases/",
"https://security.gentoo.org/glsa/201903-10",
"https://security.netapp.com/advisory/ntap-20181126-0001/",
"https://usn.ubuntu.com/3840-1/",
"https://www.debian.org/security/2018/dsa-4348",
"https://www.debian.org/security/2018/dsa-4355",
"https://www.exploit-db.com/exploits/45785/",
"https://www.openssl.org/news/secadv/20181112.txt",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html",
"https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html",
"https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html",
"https://www.tenable.com/security/tns-2018-16",
"https://www.tenable.com/security/tns-2018-17"
]
},
{
"VulnerabilityID": "CVE-2019-5010",
"PkgName": "python",
"InstalledVersion": "2.7.5-76.el7",
"FixedVersion": "2.7.5-86.el7",
"Title": "python: NULL pointer dereference using a specially crafted X509 certificate",
"Description": "A null pointer dereference vulnerability was found in the certificate parsing code in Python. This causes a denial of service to applications when parsing specially crafted certificates. This vulnerability is unlikely to be triggered if application enables SSL/TLS certificate validation and accepts certificates only from trusted root certificate authorities.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5010",
"https://python-security.readthedocs.io/vuln/ssl-crl-dps-dos.html"
]
},
{
"VulnerabilityID": "CVE-2019-5010",
"PkgName": "python-libs",
"InstalledVersion": "2.7.5-76.el7",
"FixedVersion": "2.7.5-86.el7",
"Title": "python: NULL pointer dereference using a specially crafted X509 certificate",
"Description": "A null pointer dereference vulnerability was found in the certificate parsing code in Python. This causes a denial of service to applications when parsing specially crafted certificates. This vulnerability is unlikely to be triggered if application enables SSL/TLS certificate validation and accepts certificates only from trusted root certificate authorities.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5010",
"https://python-security.readthedocs.io/vuln/ssl-crl-dps-dos.html"
]
},
{
"VulnerabilityID": "CVE-2018-16866",
"PkgName": "systemd",
"InstalledVersion": "219-62.el7_6.5",
"FixedVersion": "219-67.el7",
"Title": "systemd: out-of-bounds read when parsing a crafted syslog message",
"Description": "An out of bounds read was discovered in systemd-journald in the way it parses log messages that terminate with a colon ':'. A local attacker can use this flaw to disclose process memory data. Versions from v221 to v239 are vulnerable.",
"Severity": "LOW",
"References": [
"http://packetstormsecurity.com/files/152841/System-Down-A-systemd-journald-Exploit.html",
"http://seclists.org/fulldisclosure/2019/May/21",
"http://www.openwall.com/lists/oss-security/2019/05/10/4",
"http://www.securityfocus.com/bid/106527",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16866",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16866",
"https://seclists.org/bugtraq/2019/May/25",
"https://security.gentoo.org/glsa/201903-07",
"https://security.netapp.com/advisory/ntap-20190117-0001/",
"https://usn.ubuntu.com/3855-1/",
"https://www.debian.org/security/2019/dsa-4367",
"https://www.qualys.com/2019/01/09/system-down/system-down.txt"
]
},
{
"VulnerabilityID": "CVE-2018-16888",
"PkgName": "systemd",
"InstalledVersion": "219-62.el7_6.5",
"FixedVersion": "219-67.el7",
"Title": "systemd: kills privileged process if unprivileged PIDFile was tampered",
"Description": "It was discovered systemd does not correctly check the content of PIDFile files before using it to kill processes. When a service is run from an unprivileged user (e.g. User field set in the service file), a local attacker who is able to write to the PIDFile of the mentioned service may use this flaw to trick systemd into killing other services and/or privileged processes. Versions before v237 are vulnerable.",
"Severity": "LOW",
"References": [
"https://access.redhat.com/errata/RHSA-2019:2091",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16888",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16888",
"https://lists.apache.org/thread.html/5960a34a524848cd722fd7ab7e2227eac10107b0f90d9d1e9c3caa74@%3Cuser.cassandra.apache.org%3E",
"https://security.netapp.com/advisory/ntap-20190307-0007/"
]
},
{
"VulnerabilityID": "CVE-2018-16866",
"PkgName": "systemd-libs",
"InstalledVersion": "219-62.el7_6.5",
"FixedVersion": "219-67.el7",
"Title": "systemd: out-of-bounds read when parsing a crafted syslog message",
"Description": "An out of bounds read was discovered in systemd-journald in the way it parses log messages that terminate with a colon ':'. A local attacker can use this flaw to disclose process memory data. Versions from v221 to v239 are vulnerable.",
"Severity": "LOW",
"References": [
"http://packetstormsecurity.com/files/152841/System-Down-A-systemd-journald-Exploit.html",
"http://seclists.org/fulldisclosure/2019/May/21",
"http://www.openwall.com/lists/oss-security/2019/05/10/4",
"http://www.securityfocus.com/bid/106527",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16866",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16866",
"https://seclists.org/bugtraq/2019/May/25",
"https://security.gentoo.org/glsa/201903-07",
"https://security.netapp.com/advisory/ntap-20190117-0001/",
"https://usn.ubuntu.com/3855-1/",
"https://www.debian.org/security/2019/dsa-4367",
"https://www.qualys.com/2019/01/09/system-down/system-down.txt"
]
},
{
"VulnerabilityID": "CVE-2018-16888",
"PkgName": "systemd-libs",
"InstalledVersion": "219-62.el7_6.5",
"FixedVersion": "219-67.el7",
"Title": "systemd: kills privileged process if unprivileged PIDFile was tampered",
"Description": "It was discovered systemd does not correctly check the content of PIDFile files before using it to kill processes. When a service is run from an unprivileged user (e.g. User field set in the service file), a local attacker who is able to write to the PIDFile of the mentioned service may use this flaw to trick systemd into killing other services and/or privileged processes. Versions before v237 are vulnerable.",
"Severity": "LOW",
"References": [
"https://access.redhat.com/errata/RHSA-2019:2091",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16888",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16888",
"https://lists.apache.org/thread.html/5960a34a524848cd722fd7ab7e2227eac10107b0f90d9d1e9c3caa74@%3Cuser.cassandra.apache.org%3E",
"https://security.netapp.com/advisory/ntap-20190307-0007/"
]
}
]
}
]

11930
integration/testdata/centos-7.json.golden vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
[
{
"Target": "testdata/fixtures/debian-buster.tar.gz (debian 10.1)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "e2fsprogs",
"InstalledVersion": "1.44.5-1+deb10u1",
"FixedVersion": "1.44.5-1+deb10u2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "libcom-err2",
"InstalledVersion": "1.44.5-1+deb10u1",
"FixedVersion": "1.44.5-1+deb10u2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "libext2fs2",
"InstalledVersion": "1.44.5-1+deb10u1",
"FixedVersion": "1.44.5-1+deb10u2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "libss2",
"InstalledVersion": "1.44.5-1+deb10u1",
"FixedVersion": "1.44.5-1+deb10u2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
}
]
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,45 @@
[
{
"Target": "testdata/fixtures/distroless-base.tar.gz (debian 9.9)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-1563",
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.0k-1~deb9u1",
"FixedVersion": "1.1.0l-1~deb9u1",
"Title": "openssl: information disclosure in PKCS7_dataDecode and CMS_decrypt_set1_pkey",
"Description": "In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMS_decrypt or PKCS7_decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "MEDIUM",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1563",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=08229ad838c50f644d7e928e2eef147b4308ad64",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=631f94db0065c78181ca9ba5546ebc8bb3884b97",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
},
{
"VulnerabilityID": "CVE-2019-1563",
"PkgName": "openssl",
"InstalledVersion": "1.1.0k-1~deb9u1",
"FixedVersion": "1.1.0l-1~deb9u1",
"Title": "openssl: information disclosure in PKCS7_dataDecode and CMS_decrypt_set1_pkey",
"Description": "In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMS_decrypt or PKCS7_decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "MEDIUM",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1563",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=08229ad838c50f644d7e928e2eef147b4308ad64",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=631f94db0065c78181ca9ba5546ebc8bb3884b97",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
}
]
}
]

View File

@@ -0,0 +1,417 @@
[
{
"Target": "testdata/fixtures/distroless-base.tar.gz (debian 9.9)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2018-1000001",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: realpath() buffer underflow when getcwd() returns relative path allows privilege escalation",
"Description": "In glibc 2.26 and earlier there is confusion in the usage of getcwd() by realpath() which can be used to write before the destination buffer leading to a buffer underflow and potential code execution.",
"Severity": "HIGH",
"References": [
"http://seclists.org/oss-sec/2018/q1/38",
"http://www.securityfocus.com/bid/102525",
"http://www.securitytracker.com/id/1040162",
"https://access.redhat.com/errata/RHSA-2018:0805",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000001",
"https://security.netapp.com/advisory/ntap-20190404-0003/",
"https://usn.ubuntu.com/3534-1/",
"https://usn.ubuntu.com/3536-1/",
"https://www.exploit-db.com/exploits/43775/",
"https://www.exploit-db.com/exploits/44889/",
"https://www.halfdog.net/Security/2017/LibcRealpathBufferUnderflow/"
]
},
{
"VulnerabilityID": "CVE-2018-6485",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: Integer overflow in posix_memalign in memalign functions",
"Description": "An integer overflow in the implementation of the posix_memalign in memalign functions in the GNU C Library (aka glibc or libc6) 2.26 and earlier could cause these functions to return a pointer to a heap area that is too small, potentially leading to heap corruption.",
"Severity": "HIGH",
"References": [
"http://bugs.debian.org/878159",
"http://www.securityfocus.com/bid/102912",
"https://access.redhat.com/errata/RHBA-2019:0327",
"https://access.redhat.com/errata/RHSA-2018:3092",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6485",
"https://security.netapp.com/advisory/ntap-20190404-0003/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=22343",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-6551",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: integer overflow in malloc functions",
"Description": "The malloc implementation in the GNU C Library (aka glibc or libc6), from version 2.24 to 2.26 on powerpc, and only in version 2.26 on i386, did not properly handle malloc calls with arguments close to SIZE_MAX and could return a pointer to a heap region that is smaller than requested, eventually leading to heap corruption.",
"Severity": "HIGH",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6551",
"https://security.netapp.com/advisory/ntap-20190404-0003/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=22774",
"https://sourceware.org/git/?p=glibc.git;a=commit;h=8e448310d74b283c5cd02b9ed7fb997b47bf9b22"
]
},
{
"VulnerabilityID": "CVE-2019-1010022",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: stack guard protection bypass",
"Description": "GNU Libc current is affected by: Mitigation bypass. The impact is: Attacker may bypass stack guard protection. The component is: nptl. The attack vector is: Exploit stack buffer overflow vulnerability and use this bypass vulnerability to bypass stack guard.",
"Severity": "HIGH",
"References": [
"https://sourceware.org/bugzilla/show_bug.cgi?id=22850"
]
},
{
"VulnerabilityID": "CVE-2019-9169",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: regular-expression match via proceed_next_node in posix/regexec.c leads to heap-based buffer over-read",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.29, proceed_next_node in posix/regexec.c has a heap-based buffer over-read via an attempted case-insensitive regular-expression match.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/107160",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9169",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34140",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34142",
"https://kc.mcafee.com/corporate/index?page=content\u0026id=SB10278",
"https://security.netapp.com/advisory/ntap-20190315-0002/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=24114",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=583dd860d5b833037175247230a328f0050dbfe9",
"https://support.f5.com/csp/article/K54823184"
]
},
{
"VulnerabilityID": "CVE-2009-5155",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: parse_reg_exp in posix/regcomp.c misparses alternatives leading to denial of service or trigger incorrect result",
"Description": "In the GNU C Library (aka glibc or libc6) before 2.28, parse_reg_exp in posix/regcomp.c misparses alternatives, which allows attackers to cause a denial of service (assertion failure and application exit) or trigger an incorrect result by attempting a regular-expression match.",
"Severity": "MEDIUM",
"References": [
"http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=5513b40999149090987a0341c018d05d3eea1272",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-5155",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22793",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32806",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34238",
"https://security.netapp.com/advisory/ntap-20190315-0002/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=11053",
"https://sourceware.org/bugzilla/show_bug.cgi?id=18986",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eb04c21373e2a2885f3d52ff192b0499afe3c672",
"https://support.f5.com/csp/article/K64119434"
]
},
{
"VulnerabilityID": "CVE-2010-4051",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "CVE-2010-4052 glibc: De-recursivise regular expression engine",
"Description": "The regcomp implementation in the GNU C Library (aka glibc or libc6) through 2.11.3, and 2.12.x through 2.12.2, allows context-dependent attackers to cause a denial of service (application crash) via a regular expression containing adjacent bounded repetitions that bypass the intended RE_DUP_MAX limitation, as demonstrated by a {10,}{10,}{10,}{10,}{10,} sequence in the proftpd.gnu.c exploit for ProFTPD, related to a \"RE_DUP_MAX overflow.\"",
"Severity": "MEDIUM",
"References": [
"http://cxib.net/stuff/proftpd.gnu.c",
"http://seclists.org/fulldisclosure/2011/Jan/78",
"http://secunia.com/advisories/42547",
"http://securityreason.com/achievement_securityalert/93",
"http://securityreason.com/securityalert/8003",
"http://securitytracker.com/id?1024832",
"http://www.exploit-db.com/exploits/15935",
"http://www.kb.cert.org/vuls/id/912279",
"http://www.securityfocus.com/archive/1/515589/100/0/threaded",
"http://www.securityfocus.com/bid/45233",
"https://bugzilla.redhat.com/show_bug.cgi?id=645859"
]
},
{
"VulnerabilityID": "CVE-2010-4052",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "CVE-2010-4051 CVE-2010-4052 glibc: De-recursivise regular expression engine",
"Description": "Stack consumption vulnerability in the regcomp implementation in the GNU C Library (aka glibc or libc6) through 2.11.3, and 2.12.x through 2.12.2, allows context-dependent attackers to cause a denial of service (resource exhaustion) via a regular expression containing adjacent repetition operators, as demonstrated by a {10,}{10,}{10,}{10,} sequence in the proftpd.gnu.c exploit for ProFTPD.",
"Severity": "MEDIUM",
"References": [
"http://cxib.net/stuff/proftpd.gnu.c",
"http://seclists.org/fulldisclosure/2011/Jan/78",
"http://secunia.com/advisories/42547",
"http://securityreason.com/achievement_securityalert/93",
"http://securityreason.com/securityalert/8003",
"http://securitytracker.com/id?1024832",
"http://www.exploit-db.com/exploits/15935",
"http://www.kb.cert.org/vuls/id/912279",
"http://www.securityfocus.com/archive/1/515589/100/0/threaded",
"http://www.securityfocus.com/bid/45233",
"https://bugzilla.redhat.com/show_bug.cgi?id=645859"
]
},
{
"VulnerabilityID": "CVE-2010-4756",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: glob implementation can cause excessive CPU and memory consumption due to crafted glob expressions",
"Description": "The glob implementation in the GNU C Library (aka glibc or libc6) allows remote authenticated users to cause a denial of service (CPU and memory consumption) via crafted glob expressions that do not match any pathnames, as demonstrated by glob expressions in STAT commands to an FTP daemon, a different vulnerability than CVE-2010-2632.",
"Severity": "MEDIUM",
"References": [
"http://cxib.net/stuff/glob-0day.c",
"http://securityreason.com/achievement_securityalert/89",
"http://securityreason.com/exploitalert/9223"
]
},
{
"VulnerabilityID": "CVE-2015-8985",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: potential denial of service in pop_fail_stack()",
"Description": "The pop_fail_stack function in the GNU C Library (aka glibc or libc6) allows context-dependent attackers to cause a denial of service (assertion failure and application crash) via vectors related to extended regular expression processing.",
"Severity": "MEDIUM",
"References": [
"http://www.openwall.com/lists/oss-security/2017/02/14/9",
"http://www.securityfocus.com/bid/76916",
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779392",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-8985",
"https://security.gentoo.org/glsa/201908-06"
]
},
{
"VulnerabilityID": "CVE-2016-10228",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: iconv program can hang when invoked with the -c option",
"Description": "The iconv program in the GNU C Library (aka glibc or libc6) 2.25 and earlier, when invoked with the -c option, enters an infinite loop when processing invalid multi-byte input sequences, leading to a denial of service.",
"Severity": "MEDIUM",
"References": [
"http://openwall.com/lists/oss-security/2017/03/01/10",
"http://www.securityfocus.com/bid/96525",
"https://sourceware.org/bugzilla/show_bug.cgi?id=19519"
]
},
{
"VulnerabilityID": "CVE-2016-10739",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: getaddrinfo should reject IP addresses with trailing characters",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.28, the getaddrinfo function would successfully parse a string that contained an IPv4 address followed by whitespace and arbitrary characters, which could lead applications to incorrectly assume that it had parsed a valid string, without the possibility of embedded HTTP headers or other potentially dangerous substrings.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00082.html",
"http://www.securityfocus.com/bid/106672",
"https://access.redhat.com/errata/RHSA-2019:2118",
"https://bugzilla.redhat.com/show_bug.cgi?id=1347549",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10739",
"https://sourceware.org/bugzilla/show_bug.cgi?id=20018"
]
},
{
"VulnerabilityID": "CVE-2017-12132",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: Fragmentation attacks possible when EDNS0 is enabled",
"Description": "The DNS stub resolver in the GNU C Library (aka glibc or libc6) before version 2.26, when EDNS support is enabled, will solicit large UDP responses from name servers, potentially simplifying off-path DNS spoofing attacks due to IP fragmentation.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/100598",
"https://access.redhat.com/errata/RHSA-2018:0805",
"https://arxiv.org/pdf/1205.4011.pdf",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12132",
"https://sourceware.org/bugzilla/show_bug.cgi?id=21361"
]
},
{
"VulnerabilityID": "CVE-2018-20796",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: uncontrolled recursion in function check_dst_limits_calc_pos_1 in posix/regexec.c",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.29, check_dst_limits_calc_pos_1 in posix/regexec.c has Uncontrolled Recursion, as demonstrated by '(\\227|)(\\\\1\\\\1|t1|\\\\\\2537)+' in grep.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/107160",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34141",
"https://lists.gnu.org/archive/html/bug-gnulib/2019-01/msg00108.html",
"https://security.netapp.com/advisory/ntap-20190315-0002/"
]
},
{
"VulnerabilityID": "CVE-2019-1010023",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Description": "GNU Libc current is affected by: Re-mapping current loaded libray with malicious ELF file. The impact is: In worst case attacker may evaluate privileges. The component is: libld. The attack vector is: Attacker sends 2 ELF files to victim and asks to run ldd on it. ldd execute code.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/109167",
"https://sourceware.org/bugzilla/show_bug.cgi?id=22851",
"https://support.f5.com/csp/article/K11932200?utm_source=f5support\u0026amp;utm_medium=RSS"
]
},
{
"VulnerabilityID": "CVE-2019-1010024",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Description": "GNU Libc current is affected by: Mitigation bypass. The impact is: Attacker may bypass ASLR using cache of thread stack and heap. The component is: glibc.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/109162",
"https://sourceware.org/bugzilla/show_bug.cgi?id=22852",
"https://support.f5.com/csp/article/K06046097"
]
},
{
"VulnerabilityID": "CVE-2019-1010025",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: information disclosure of heap addresses of pthread_created thread",
"Description": "** DISPUTED ** GNU Libc current is affected by: Mitigation bypass. The impact is: Attacker may guess the heap addresses of pthread_created thread. The component is: glibc. NOTE: the vendor's position is \"ASLR bypass itself is not a vulnerability.\"",
"Severity": "MEDIUM",
"References": [
"https://sourceware.org/bugzilla/show_bug.cgi?id=22853"
]
},
{
"VulnerabilityID": "CVE-2019-6488",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: Incorrect attempt to use a 64-bit register for size_t in assembly codes results in segmentation fault",
"Description": "The string component in the GNU C Library (aka glibc or libc6) through 2.28, when running on the x32 architecture, incorrectly attempts to use a 64-bit register for size_t in assembly codes, which can lead to a segmentation fault or possibly unspecified other impact, as demonstrated by a crash in __memmove_avx_unaligned_erms in sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S during a memcpy.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/106671",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6488",
"https://sourceware.org/bugzilla/show_bug.cgi?id=24097"
]
},
{
"VulnerabilityID": "CVE-2019-9192",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: uncontrolled recursion in function check_dst_limits_calc_pos_1 in posix/regexec.c",
"Description": "** DISPUTED ** In the GNU C Library (aka glibc or libc6) through 2.29, check_dst_limits_calc_pos_1 in posix/regexec.c has Uncontrolled Recursion, as demonstrated by '(|)(\\\\1\\\\1)*' in grep, a different issue than CVE-2018-20796. NOTE: the software maintainer disputes that this is a vulnerability because the behavior occurs only with a crafted pattern.",
"Severity": "MEDIUM",
"References": [
"https://sourceware.org/bugzilla/show_bug.cgi?id=24269"
]
},
{
"VulnerabilityID": "CVE-2019-7309",
"PkgName": "libc6",
"InstalledVersion": "2.24-11+deb9u4",
"Title": "glibc: memcmp function incorrectly returns zero",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.29, the memcmp function for the x32 architecture can incorrectly return zero (indicating that the inputs are equal) because the RDX most significant bit is mishandled.",
"Severity": "LOW",
"References": [
"http://www.securityfocus.com/bid/106835",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-7309",
"https://sourceware.org/bugzilla/show_bug.cgi?id=24155",
"https://sourceware.org/ml/libc-alpha/2019-02/msg00041.html"
]
},
{
"VulnerabilityID": "CVE-2007-6755",
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.0k-1~deb9u1",
"Title": "Dual_EC_DRBG: weak pseudo random number generator",
"Description": "The NIST SP 800-90A default statement of the Dual Elliptic Curve Deterministic Random Bit Generation (Dual_EC_DRBG) algorithm contains point Q constants with a possible relationship to certain \"skeleton key\" values, which might allow context-dependent attackers to defeat cryptographic protection mechanisms by leveraging knowledge of those values. NOTE: this is a preliminary CVE for Dual_EC_DRBG; future research may provide additional details about point Q and associated attacks, and could potentially lead to a RECAST or REJECT of this CVE.",
"Severity": "MEDIUM",
"References": [
"http://arstechnica.com/security/2013/09/stop-using-nsa-influence-code-in-our-product-rsa-tells-customers/",
"http://blog.cryptographyengineering.com/2013/09/rsa-warns-developers-against-its-own.html",
"http://blog.cryptographyengineering.com/2013/09/the-many-flaws-of-dualecdrbg.html",
"http://rump2007.cr.yp.to/15-shumow.pdf",
"http://stream.wsj.com/story/latest-headlines/SS-2-63399/SS-2-332655/",
"http://threatpost.com/in-wake-of-latest-crypto-revelations-everything-is-suspect",
"http://www.securityfocus.com/bid/63657",
"https://www.schneier.com/blog/archives/2007/11/the_strange_sto.html"
]
},
{
"VulnerabilityID": "CVE-2010-0928",
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.0k-1~deb9u1",
"Title": "openssl: RSA authentication weakness",
"Description": "OpenSSL 0.9.8i on the Gaisler Research LEON3 SoC on the Xilinx Virtex-II Pro FPGA uses a Fixed Width Exponentiation (FWE) algorithm for certain signature calculations, and does not verify the signature before providing it to a caller, which makes it easier for physically proximate attackers to determine the private key via a modified supply voltage for the microprocessor, related to a \"fault-based attack.\"",
"Severity": "MEDIUM",
"References": [
"http://rdist.root.org/2010/03/08/attacking-rsa-exponentiation-with-fault-injection/",
"http://www.eecs.umich.edu/%7Evaleria/research/publications/DATE10RSA.pdf",
"http://www.networkworld.com/news/2010/030410-rsa-security-attack.html",
"http://www.osvdb.org/62808",
"http://www.theregister.co.uk/2010/03/04/severe_openssl_vulnerability/",
"https://exchange.xforce.ibmcloud.com/vulnerabilities/56750"
]
},
{
"VulnerabilityID": "CVE-2019-1563",
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.0k-1~deb9u1",
"FixedVersion": "1.1.0l-1~deb9u1",
"Title": "openssl: information disclosure in PKCS7_dataDecode and CMS_decrypt_set1_pkey",
"Description": "In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMS_decrypt or PKCS7_decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "MEDIUM",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1563",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=08229ad838c50f644d7e928e2eef147b4308ad64",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=631f94db0065c78181ca9ba5546ebc8bb3884b97",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
},
{
"VulnerabilityID": "CVE-2007-6755",
"PkgName": "openssl",
"InstalledVersion": "1.1.0k-1~deb9u1",
"Title": "Dual_EC_DRBG: weak pseudo random number generator",
"Description": "The NIST SP 800-90A default statement of the Dual Elliptic Curve Deterministic Random Bit Generation (Dual_EC_DRBG) algorithm contains point Q constants with a possible relationship to certain \"skeleton key\" values, which might allow context-dependent attackers to defeat cryptographic protection mechanisms by leveraging knowledge of those values. NOTE: this is a preliminary CVE for Dual_EC_DRBG; future research may provide additional details about point Q and associated attacks, and could potentially lead to a RECAST or REJECT of this CVE.",
"Severity": "MEDIUM",
"References": [
"http://arstechnica.com/security/2013/09/stop-using-nsa-influence-code-in-our-product-rsa-tells-customers/",
"http://blog.cryptographyengineering.com/2013/09/rsa-warns-developers-against-its-own.html",
"http://blog.cryptographyengineering.com/2013/09/the-many-flaws-of-dualecdrbg.html",
"http://rump2007.cr.yp.to/15-shumow.pdf",
"http://stream.wsj.com/story/latest-headlines/SS-2-63399/SS-2-332655/",
"http://threatpost.com/in-wake-of-latest-crypto-revelations-everything-is-suspect",
"http://www.securityfocus.com/bid/63657",
"https://www.schneier.com/blog/archives/2007/11/the_strange_sto.html"
]
},
{
"VulnerabilityID": "CVE-2010-0928",
"PkgName": "openssl",
"InstalledVersion": "1.1.0k-1~deb9u1",
"Title": "openssl: RSA authentication weakness",
"Description": "OpenSSL 0.9.8i on the Gaisler Research LEON3 SoC on the Xilinx Virtex-II Pro FPGA uses a Fixed Width Exponentiation (FWE) algorithm for certain signature calculations, and does not verify the signature before providing it to a caller, which makes it easier for physically proximate attackers to determine the private key via a modified supply voltage for the microprocessor, related to a \"fault-based attack.\"",
"Severity": "MEDIUM",
"References": [
"http://rdist.root.org/2010/03/08/attacking-rsa-exponentiation-with-fault-injection/",
"http://www.eecs.umich.edu/%7Evaleria/research/publications/DATE10RSA.pdf",
"http://www.networkworld.com/news/2010/030410-rsa-security-attack.html",
"http://www.osvdb.org/62808",
"http://www.theregister.co.uk/2010/03/04/severe_openssl_vulnerability/",
"https://exchange.xforce.ibmcloud.com/vulnerabilities/56750"
]
},
{
"VulnerabilityID": "CVE-2019-1563",
"PkgName": "openssl",
"InstalledVersion": "1.1.0k-1~deb9u1",
"FixedVersion": "1.1.0l-1~deb9u1",
"Title": "openssl: information disclosure in PKCS7_dataDecode and CMS_decrypt_set1_pkey",
"Description": "In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMS_decrypt or PKCS7_decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).",
"Severity": "MEDIUM",
"References": [
"http://packetstormsecurity.com/files/154467/Slackware-Security-Advisory-openssl-Updates.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1563",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=08229ad838c50f644d7e928e2eef147b4308ad64",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=631f94db0065c78181ca9ba5546ebc8bb3884b97",
"https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f",
"https://seclists.org/bugtraq/2019/Sep/25",
"https://security.netapp.com/advisory/ntap-20190919-0002/",
"https://www.openssl.org/news/secadv/20190910.txt"
]
}
]
}
]

File diff suppressed because it is too large Load Diff

BIN
integration/testdata/trivy.db.gz vendored Normal file

Binary file not shown.

10367
integration/testdata/ubi-7.json.golden vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,118 @@
[
{
"Target": "testdata/fixtures/ubuntu-1804.tar.gz (ubuntu 18.04)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "e2fsprogs",
"InstalledVersion": "1.44.1-1ubuntu1.1",
"FixedVersion": "1.44.1-1ubuntu1.2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "libcom-err2",
"InstalledVersion": "1.44.1-1ubuntu1.1",
"FixedVersion": "1.44.1-1ubuntu1.2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "libext2fs2",
"InstalledVersion": "1.44.1-1ubuntu1.1",
"FixedVersion": "1.44.1-1ubuntu1.2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "libss2",
"InstalledVersion": "1.44.1-1ubuntu1.1",
"FixedVersion": "1.44.1-1ubuntu1.2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2019-15718",
"PkgName": "libsystemd0",
"InstalledVersion": "237-3ubuntu10.25",
"FixedVersion": "237-3ubuntu10.28",
"Title": "systemd: systemd-resolved allows unprivileged users to configure DNS",
"Description": "In systemd 240, bus_open_system_watch_bind_with_description in shared/bus-util.c (as used by systemd-resolved to connect to the system D-Bus instance), calls sd_bus_set_trusted, which disables access controls for incoming D-Bus messages. An unprivileged user can exploit this by executing D-Bus methods that should be restricted to privileged users, in order to change the system's DNS resolver settings.",
"Severity": "LOW",
"References": [
"http://www.openwall.com/lists/oss-security/2019/09/03/1",
"https://bugzilla.redhat.com/show_bug.cgi?id=1746057",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BRE5IS24XTF5WNZGH2L7GSQJKARBOEGL/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HIKGKXZ5OEGOEYURHLJHEMFYNLEGAW5B/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U2WNHRJW4XI6H5YMDG4BUFGPAXWUMUVG/"
]
},
{
"VulnerabilityID": "CVE-2019-15718",
"PkgName": "libudev1",
"InstalledVersion": "237-3ubuntu10.25",
"FixedVersion": "237-3ubuntu10.28",
"Title": "systemd: systemd-resolved allows unprivileged users to configure DNS",
"Description": "In systemd 240, bus_open_system_watch_bind_with_description in shared/bus-util.c (as used by systemd-resolved to connect to the system D-Bus instance), calls sd_bus_set_trusted, which disables access controls for incoming D-Bus messages. An unprivileged user can exploit this by executing D-Bus methods that should be restricted to privileged users, in order to change the system's DNS resolver settings.",
"Severity": "LOW",
"References": [
"http://www.openwall.com/lists/oss-security/2019/09/03/1",
"https://bugzilla.redhat.com/show_bug.cgi?id=1746057",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BRE5IS24XTF5WNZGH2L7GSQJKARBOEGL/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HIKGKXZ5OEGOEYURHLJHEMFYNLEGAW5B/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U2WNHRJW4XI6H5YMDG4BUFGPAXWUMUVG/"
]
},
{
"VulnerabilityID": "CVE-2019-11922",
"PkgName": "libzstd1",
"InstalledVersion": "1.3.3+dfsg-2ubuntu1",
"FixedVersion": "1.3.3+dfsg-2ubuntu1.1",
"Description": "A race condition in the one-pass compression functions of Zstandard prior to version 1.3.8 could allow an attacker to write bytes out of bounds if an output buffer smaller than the recommended size was used.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00008.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00062.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11922",
"https://github.com/facebook/zstd/pull/1404/commits/3e5cdf1b6a85843e991d7d10f6a2567c15580da0",
"https://www.facebook.com/security/advisories/cve-2019-11922"
]
}
]
}
]

View File

@@ -0,0 +1,933 @@
[
{
"Target": "testdata/fixtures/ubuntu-1804.tar.gz (ubuntu 18.04)",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2018-7738",
"PkgName": "bsdutils",
"InstalledVersion": "2.31.1-0.4ubuntu3.3",
"Title": "util-linux: Shell command injection in unescaped bash-completed mount point names",
"Description": "In util-linux before 2.32-rc1, bash-completion/umount allows local users to gain privileges by embedding shell commands in a mountpoint name, which is mishandled during a umount command (within Bash) by a different user, as demonstrated by logging in as root and entering umount followed by a tab character for autocompletion.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/103367",
"https://bugs.debian.org/892179",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7738",
"https://github.com/karelzak/util-linux/commit/75f03badd7ed9f1dd951863d75e756883d3acc55",
"https://github.com/karelzak/util-linux/issues/539",
"https://www.debian.org/security/2018/dsa-4134"
]
},
{
"VulnerabilityID": "CVE-2016-2781",
"PkgName": "coreutils",
"InstalledVersion": "8.28-1ubuntu1",
"Title": "coreutils: Non-privileged session can escape to the parent session in chroot",
"Description": "chroot in GNU coreutils, when used with --userspec, allows local users to escape to the parent session via a crafted TIOCSTI ioctl call, which pushes characters to the terminal's input buffer.",
"Severity": "LOW",
"References": [
"http://www.openwall.com/lists/oss-security/2016/02/28/2",
"http://www.openwall.com/lists/oss-security/2016/02/28/3"
]
},
{
"VulnerabilityID": "CVE-2017-8283",
"PkgName": "dpkg",
"InstalledVersion": "1.19.0.5ubuntu2.1",
"Description": "dpkg-source in dpkg 1.3.0 through 1.18.23 is able to use a non-GNU patch program and does not offer a protection mechanism for blank-indented diff hunks, which allows remote attackers to conduct directory traversal attacks via a crafted Debian source package, as demonstrated by use of dpkg-source on NetBSD.",
"Severity": "HIGH",
"References": [
"http://www.openwall.com/lists/oss-security/2017/04/20/2",
"http://www.securityfocus.com/bid/98064",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8283"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "e2fsprogs",
"InstalledVersion": "1.44.1-1ubuntu1.1",
"FixedVersion": "1.44.1-1ubuntu1.2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2018-7738",
"PkgName": "fdisk",
"InstalledVersion": "2.31.1-0.4ubuntu3.3",
"Title": "util-linux: Shell command injection in unescaped bash-completed mount point names",
"Description": "In util-linux before 2.32-rc1, bash-completion/umount allows local users to gain privileges by embedding shell commands in a mountpoint name, which is mishandled during a umount command (within Bash) by a different user, as demonstrated by logging in as root and entering umount followed by a tab character for autocompletion.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/103367",
"https://bugs.debian.org/892179",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7738",
"https://github.com/karelzak/util-linux/commit/75f03badd7ed9f1dd951863d75e756883d3acc55",
"https://github.com/karelzak/util-linux/issues/539",
"https://www.debian.org/security/2018/dsa-4134"
]
},
{
"VulnerabilityID": "CVE-2019-13050",
"PkgName": "gpgv",
"InstalledVersion": "2.2.4-1ubuntu1.2",
"Title": "GnuPG: interaction between the sks-keyserver code and GnuPG allows for a Certificate Spamming Attack which leads to persistent DoS",
"Description": "Interaction between the sks-keyserver code through 1.2.0 of the SKS keyserver network, and GnuPG through 2.2.16, makes it risky to have a GnuPG keyserver configuration line referring to a host on the SKS keyserver network. Retrieving data from this network may cause a persistent denial of service, because of a Certificate Spamming Attack.",
"Severity": "MEDIUM",
"References": [
"https://access.redhat.com/articles/4264021",
"https://gist.github.com/rjhansen/67ab921ffb4084c865b3618d6955275f",
"https://lists.gnupg.org/pipermail/gnupg-announce/2019q3/000439.html",
"https://twitter.com/lambdafu/status/1147162583969009664"
]
},
{
"VulnerabilityID": "CVE-2018-7738",
"PkgName": "libblkid1",
"InstalledVersion": "2.31.1-0.4ubuntu3.3",
"Title": "util-linux: Shell command injection in unescaped bash-completed mount point names",
"Description": "In util-linux before 2.32-rc1, bash-completion/umount allows local users to gain privileges by embedding shell commands in a mountpoint name, which is mishandled during a umount command (within Bash) by a different user, as demonstrated by logging in as root and entering umount followed by a tab character for autocompletion.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/103367",
"https://bugs.debian.org/892179",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7738",
"https://github.com/karelzak/util-linux/commit/75f03badd7ed9f1dd951863d75e756883d3acc55",
"https://github.com/karelzak/util-linux/issues/539",
"https://www.debian.org/security/2018/dsa-4134"
]
},
{
"VulnerabilityID": "CVE-2018-11236",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: Integer overflow in stdlib/canonicalize.c on 32-bit architectures leading to stack-based buffer overflow",
"Description": "stdlib/canonicalize.c in the GNU C Library (aka glibc or libc6) 2.27 and earlier, when processing very long pathname arguments to the realpath function, could encounter an integer overflow on 32-bit architectures, leading to a stack-based buffer overflow and, potentially, arbitrary code execution.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/104255",
"https://access.redhat.com/errata/RHBA-2019:0327",
"https://access.redhat.com/errata/RHSA-2018:3092",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-11236",
"https://security.netapp.com/advisory/ntap-20190329-0001/",
"https://security.netapp.com/advisory/ntap-20190401-0001/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=22786",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5460617d1567657621107d895ee2dd83bc1f88f2",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2019-9169",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: regular-expression match via proceed_next_node in posix/regexec.c leads to heap-based buffer over-read",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.29, proceed_next_node in posix/regexec.c has a heap-based buffer over-read via an attempted case-insensitive regular-expression match.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/107160",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9169",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34140",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34142",
"https://kc.mcafee.com/corporate/index?page=content\u0026id=SB10278",
"https://security.netapp.com/advisory/ntap-20190315-0002/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=24114",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=583dd860d5b833037175247230a328f0050dbfe9",
"https://support.f5.com/csp/article/K54823184"
]
},
{
"VulnerabilityID": "CVE-2009-5155",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: parse_reg_exp in posix/regcomp.c misparses alternatives leading to denial of service or trigger incorrect result",
"Description": "In the GNU C Library (aka glibc or libc6) before 2.28, parse_reg_exp in posix/regcomp.c misparses alternatives, which allows attackers to cause a denial of service (assertion failure and application exit) or trigger an incorrect result by attempting a regular-expression match.",
"Severity": "MEDIUM",
"References": [
"http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=5513b40999149090987a0341c018d05d3eea1272",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-5155",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22793",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32806",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34238",
"https://security.netapp.com/advisory/ntap-20190315-0002/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=11053",
"https://sourceware.org/bugzilla/show_bug.cgi?id=18986",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eb04c21373e2a2885f3d52ff192b0499afe3c672",
"https://support.f5.com/csp/article/K64119434"
]
},
{
"VulnerabilityID": "CVE-2015-8985",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: potential denial of service in pop_fail_stack()",
"Description": "The pop_fail_stack function in the GNU C Library (aka glibc or libc6) allows context-dependent attackers to cause a denial of service (assertion failure and application crash) via vectors related to extended regular expression processing.",
"Severity": "MEDIUM",
"References": [
"http://www.openwall.com/lists/oss-security/2017/02/14/9",
"http://www.securityfocus.com/bid/76916",
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779392",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-8985",
"https://security.gentoo.org/glsa/201908-06"
]
},
{
"VulnerabilityID": "CVE-2016-10228",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: iconv program can hang when invoked with the -c option",
"Description": "The iconv program in the GNU C Library (aka glibc or libc6) 2.25 and earlier, when invoked with the -c option, enters an infinite loop when processing invalid multi-byte input sequences, leading to a denial of service.",
"Severity": "MEDIUM",
"References": [
"http://openwall.com/lists/oss-security/2017/03/01/10",
"http://www.securityfocus.com/bid/96525",
"https://sourceware.org/bugzilla/show_bug.cgi?id=19519"
]
},
{
"VulnerabilityID": "CVE-2016-10739",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: getaddrinfo should reject IP addresses with trailing characters",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.28, the getaddrinfo function would successfully parse a string that contained an IPv4 address followed by whitespace and arbitrary characters, which could lead applications to incorrectly assume that it had parsed a valid string, without the possibility of embedded HTTP headers or other potentially dangerous substrings.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00082.html",
"http://www.securityfocus.com/bid/106672",
"https://access.redhat.com/errata/RHSA-2019:2118",
"https://bugzilla.redhat.com/show_bug.cgi?id=1347549",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10739",
"https://sourceware.org/bugzilla/show_bug.cgi?id=20018"
]
},
{
"VulnerabilityID": "CVE-2018-11237",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: Buffer overflow in __mempcpy_avx512_no_vzeroupper",
"Description": "An AVX-512-optimized implementation of the mempcpy function in the GNU C Library (aka glibc or libc6) 2.27 and earlier may write data beyond the target buffer, leading to a buffer overflow in __mempcpy_avx512_no_vzeroupper.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/104256",
"https://access.redhat.com/errata/RHBA-2019:0327",
"https://access.redhat.com/errata/RHSA-2018:3092",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-11237",
"https://security.netapp.com/advisory/ntap-20190329-0001/",
"https://security.netapp.com/advisory/ntap-20190401-0001/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=23196",
"https://www.exploit-db.com/exploits/44750/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-19591",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: file descriptor leak in if_nametoindex() in sysdeps/unix/sysv/linux/if_index.c",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.28, attempting to resolve a crafted hostname via getaddrinfo() leads to the allocation of a socket descriptor that is not closed. This is related to the if_nametoindex() function.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/106037",
"http://www.securitytracker.com/id/1042174",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-19591",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BO7WHN52GFMC5F2I2232GFIPSSXWFV7G/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/M52KE4YR3GNMHQUOS3DKAGZD5TQ5D5UH/",
"https://security.gentoo.org/glsa/201903-09",
"https://security.netapp.com/advisory/ntap-20190321-0003/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=23927",
"https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d527c860f5a3f0ed687bd03f0cb464612dc23408"
]
},
{
"VulnerabilityID": "CVE-2018-20796",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: uncontrolled recursion in function check_dst_limits_calc_pos_1 in posix/regexec.c",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.29, check_dst_limits_calc_pos_1 in posix/regexec.c has Uncontrolled Recursion, as demonstrated by '(\\227|)(\\\\1\\\\1|t1|\\\\\\2537)+' in grep.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/107160",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34141",
"https://lists.gnu.org/archive/html/bug-gnulib/2019-01/msg00108.html",
"https://security.netapp.com/advisory/ntap-20190315-0002/"
]
},
{
"VulnerabilityID": "CVE-2019-9192",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: uncontrolled recursion in function check_dst_limits_calc_pos_1 in posix/regexec.c",
"Description": "** DISPUTED ** In the GNU C Library (aka glibc or libc6) through 2.29, check_dst_limits_calc_pos_1 in posix/regexec.c has Uncontrolled Recursion, as demonstrated by '(|)(\\\\1\\\\1)*' in grep, a different issue than CVE-2018-20796. NOTE: the software maintainer disputes that this is a vulnerability because the behavior occurs only with a crafted pattern.",
"Severity": "MEDIUM",
"References": [
"https://sourceware.org/bugzilla/show_bug.cgi?id=24269"
]
},
{
"VulnerabilityID": "CVE-2019-7309",
"PkgName": "libc-bin",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: memcmp function incorrectly returns zero",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.29, the memcmp function for the x32 architecture can incorrectly return zero (indicating that the inputs are equal) because the RDX most significant bit is mishandled.",
"Severity": "LOW",
"References": [
"http://www.securityfocus.com/bid/106835",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-7309",
"https://sourceware.org/bugzilla/show_bug.cgi?id=24155",
"https://sourceware.org/ml/libc-alpha/2019-02/msg00041.html"
]
},
{
"VulnerabilityID": "CVE-2018-11236",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: Integer overflow in stdlib/canonicalize.c on 32-bit architectures leading to stack-based buffer overflow",
"Description": "stdlib/canonicalize.c in the GNU C Library (aka glibc or libc6) 2.27 and earlier, when processing very long pathname arguments to the realpath function, could encounter an integer overflow on 32-bit architectures, leading to a stack-based buffer overflow and, potentially, arbitrary code execution.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/104255",
"https://access.redhat.com/errata/RHBA-2019:0327",
"https://access.redhat.com/errata/RHSA-2018:3092",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-11236",
"https://security.netapp.com/advisory/ntap-20190329-0001/",
"https://security.netapp.com/advisory/ntap-20190401-0001/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=22786",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5460617d1567657621107d895ee2dd83bc1f88f2",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2019-9169",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: regular-expression match via proceed_next_node in posix/regexec.c leads to heap-based buffer over-read",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.29, proceed_next_node in posix/regexec.c has a heap-based buffer over-read via an attempted case-insensitive regular-expression match.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/107160",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9169",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34140",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34142",
"https://kc.mcafee.com/corporate/index?page=content\u0026id=SB10278",
"https://security.netapp.com/advisory/ntap-20190315-0002/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=24114",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=583dd860d5b833037175247230a328f0050dbfe9",
"https://support.f5.com/csp/article/K54823184"
]
},
{
"VulnerabilityID": "CVE-2009-5155",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: parse_reg_exp in posix/regcomp.c misparses alternatives leading to denial of service or trigger incorrect result",
"Description": "In the GNU C Library (aka glibc or libc6) before 2.28, parse_reg_exp in posix/regcomp.c misparses alternatives, which allows attackers to cause a denial of service (assertion failure and application exit) or trigger an incorrect result by attempting a regular-expression match.",
"Severity": "MEDIUM",
"References": [
"http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=5513b40999149090987a0341c018d05d3eea1272",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-5155",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22793",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32806",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34238",
"https://security.netapp.com/advisory/ntap-20190315-0002/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=11053",
"https://sourceware.org/bugzilla/show_bug.cgi?id=18986",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eb04c21373e2a2885f3d52ff192b0499afe3c672",
"https://support.f5.com/csp/article/K64119434"
]
},
{
"VulnerabilityID": "CVE-2015-8985",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: potential denial of service in pop_fail_stack()",
"Description": "The pop_fail_stack function in the GNU C Library (aka glibc or libc6) allows context-dependent attackers to cause a denial of service (assertion failure and application crash) via vectors related to extended regular expression processing.",
"Severity": "MEDIUM",
"References": [
"http://www.openwall.com/lists/oss-security/2017/02/14/9",
"http://www.securityfocus.com/bid/76916",
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779392",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-8985",
"https://security.gentoo.org/glsa/201908-06"
]
},
{
"VulnerabilityID": "CVE-2016-10228",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: iconv program can hang when invoked with the -c option",
"Description": "The iconv program in the GNU C Library (aka glibc or libc6) 2.25 and earlier, when invoked with the -c option, enters an infinite loop when processing invalid multi-byte input sequences, leading to a denial of service.",
"Severity": "MEDIUM",
"References": [
"http://openwall.com/lists/oss-security/2017/03/01/10",
"http://www.securityfocus.com/bid/96525",
"https://sourceware.org/bugzilla/show_bug.cgi?id=19519"
]
},
{
"VulnerabilityID": "CVE-2016-10739",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: getaddrinfo should reject IP addresses with trailing characters",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.28, the getaddrinfo function would successfully parse a string that contained an IPv4 address followed by whitespace and arbitrary characters, which could lead applications to incorrectly assume that it had parsed a valid string, without the possibility of embedded HTTP headers or other potentially dangerous substrings.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00082.html",
"http://www.securityfocus.com/bid/106672",
"https://access.redhat.com/errata/RHSA-2019:2118",
"https://bugzilla.redhat.com/show_bug.cgi?id=1347549",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10739",
"https://sourceware.org/bugzilla/show_bug.cgi?id=20018"
]
},
{
"VulnerabilityID": "CVE-2018-11237",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: Buffer overflow in __mempcpy_avx512_no_vzeroupper",
"Description": "An AVX-512-optimized implementation of the mempcpy function in the GNU C Library (aka glibc or libc6) 2.27 and earlier may write data beyond the target buffer, leading to a buffer overflow in __mempcpy_avx512_no_vzeroupper.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/104256",
"https://access.redhat.com/errata/RHBA-2019:0327",
"https://access.redhat.com/errata/RHSA-2018:3092",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-11237",
"https://security.netapp.com/advisory/ntap-20190329-0001/",
"https://security.netapp.com/advisory/ntap-20190401-0001/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=23196",
"https://www.exploit-db.com/exploits/44750/",
"https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
]
},
{
"VulnerabilityID": "CVE-2018-19591",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: file descriptor leak in if_nametoindex() in sysdeps/unix/sysv/linux/if_index.c",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.28, attempting to resolve a crafted hostname via getaddrinfo() leads to the allocation of a socket descriptor that is not closed. This is related to the if_nametoindex() function.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/106037",
"http://www.securitytracker.com/id/1042174",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-19591",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BO7WHN52GFMC5F2I2232GFIPSSXWFV7G/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/M52KE4YR3GNMHQUOS3DKAGZD5TQ5D5UH/",
"https://security.gentoo.org/glsa/201903-09",
"https://security.netapp.com/advisory/ntap-20190321-0003/",
"https://sourceware.org/bugzilla/show_bug.cgi?id=23927",
"https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD",
"https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d527c860f5a3f0ed687bd03f0cb464612dc23408"
]
},
{
"VulnerabilityID": "CVE-2018-20796",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: uncontrolled recursion in function check_dst_limits_calc_pos_1 in posix/regexec.c",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.29, check_dst_limits_calc_pos_1 in posix/regexec.c has Uncontrolled Recursion, as demonstrated by '(\\227|)(\\\\1\\\\1|t1|\\\\\\2537)+' in grep.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/107160",
"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34141",
"https://lists.gnu.org/archive/html/bug-gnulib/2019-01/msg00108.html",
"https://security.netapp.com/advisory/ntap-20190315-0002/"
]
},
{
"VulnerabilityID": "CVE-2019-9192",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: uncontrolled recursion in function check_dst_limits_calc_pos_1 in posix/regexec.c",
"Description": "** DISPUTED ** In the GNU C Library (aka glibc or libc6) through 2.29, check_dst_limits_calc_pos_1 in posix/regexec.c has Uncontrolled Recursion, as demonstrated by '(|)(\\\\1\\\\1)*' in grep, a different issue than CVE-2018-20796. NOTE: the software maintainer disputes that this is a vulnerability because the behavior occurs only with a crafted pattern.",
"Severity": "MEDIUM",
"References": [
"https://sourceware.org/bugzilla/show_bug.cgi?id=24269"
]
},
{
"VulnerabilityID": "CVE-2019-7309",
"PkgName": "libc6",
"InstalledVersion": "2.27-3ubuntu1",
"Title": "glibc: memcmp function incorrectly returns zero",
"Description": "In the GNU C Library (aka glibc or libc6) through 2.29, the memcmp function for the x32 architecture can incorrectly return zero (indicating that the inputs are equal) because the RDX most significant bit is mishandled.",
"Severity": "LOW",
"References": [
"http://www.securityfocus.com/bid/106835",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-7309",
"https://sourceware.org/bugzilla/show_bug.cgi?id=24155",
"https://sourceware.org/ml/libc-alpha/2019-02/msg00041.html"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "libcom-err2",
"InstalledVersion": "1.44.1-1ubuntu1.1",
"FixedVersion": "1.44.1-1ubuntu1.2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "libext2fs2",
"InstalledVersion": "1.44.1-1ubuntu1.1",
"FixedVersion": "1.44.1-1ubuntu1.2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2018-7738",
"PkgName": "libfdisk1",
"InstalledVersion": "2.31.1-0.4ubuntu3.3",
"Title": "util-linux: Shell command injection in unescaped bash-completed mount point names",
"Description": "In util-linux before 2.32-rc1, bash-completion/umount allows local users to gain privileges by embedding shell commands in a mountpoint name, which is mishandled during a umount command (within Bash) by a different user, as demonstrated by logging in as root and entering umount followed by a tab character for autocompletion.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/103367",
"https://bugs.debian.org/892179",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7738",
"https://github.com/karelzak/util-linux/commit/75f03badd7ed9f1dd951863d75e756883d3acc55",
"https://github.com/karelzak/util-linux/issues/539",
"https://www.debian.org/security/2018/dsa-4134"
]
},
{
"VulnerabilityID": "CVE-2019-12904",
"PkgName": "libgcrypt20",
"InstalledVersion": "1.8.1-4ubuntu1.1",
"Title": "Libgcrypt: physical addresses being available to other processes leads to a flush-and-reload side-channel attack",
"Description": "In Libgcrypt 1.8.4, the C implementation of AES is vulnerable to a flush-and-reload side-channel attack because physical addresses are available to other processes. (The C implementation is used on platforms where an assembly-language implementation is unavailable.)",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00049.html",
"https://dev.gnupg.org/T4541",
"https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020",
"https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762",
"https://people.canonical.com/~ubuntu-security/cve/2019/CVE-2019-12904.html"
]
},
{
"VulnerabilityID": "CVE-2019-13627",
"PkgName": "libgcrypt20",
"InstalledVersion": "1.8.1-4ubuntu1.1",
"Description": "It was discovered that there was a ECDSA timing attack in the libgcrypt20 cryptographic library. Version affected: 1.8.4-5, 1.7.6-2+deb9u3, and 1.6.3-2+deb8u4. Versions fixed: 1.8.5-2 and 1.6.3-2+deb8u7.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00060.html",
"http://www.openwall.com/lists/oss-security/2019/10/02/2",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-13627",
"https://github.com/gpg/libgcrypt/releases/tag/libgcrypt-1.8.5",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00024.html",
"https://minerva.crocs.fi.muni.cz/",
"https://security-tracker.debian.org/tracker/CVE-2019-13627"
]
},
{
"VulnerabilityID": "CVE-2018-16868",
"PkgName": "libgnutls30",
"InstalledVersion": "3.5.18-1ubuntu1.1",
"Title": "gnutls: Bleichenbacher-like side channel leakage in PKCS#1 v1.5 verification and padding oracle verification",
"Description": "A Bleichenbacher type side-channel based padding oracle attack was found in the way gnutls handles verification of RSA decrypted PKCS#1 v1.5 data. An attacker who is able to run process on the same physical core as the victim process, could use this to extract plaintext or in some cases downgrade any TLS connections to a vulnerable server.",
"Severity": "LOW",
"References": [
"http://cat.eyalro.net/",
"http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00017.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00068.html",
"http://www.securityfocus.com/bid/106080",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16868",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16868"
]
},
{
"VulnerabilityID": "CVE-2018-16869",
"PkgName": "libhogweed4",
"InstalledVersion": "3.4-1",
"Title": "nettle: Leaky data conversion exposing a manager oracle",
"Description": "A Bleichenbacher type side-channel based padding oracle attack was found in the way nettle handles endian conversion of RSA decrypted PKCS#1 v1.5 data. An attacker who is able to run a process on the same physical core as the victim process, could use this flaw extract plaintext or in some cases downgrade any TLS connections to a vulnerable server.",
"Severity": "LOW",
"References": [
"http://cat.eyalro.net/",
"http://www.securityfocus.com/bid/106092",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16869",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16869"
]
},
{
"VulnerabilityID": "CVE-2018-7738",
"PkgName": "libmount1",
"InstalledVersion": "2.31.1-0.4ubuntu3.3",
"Title": "util-linux: Shell command injection in unescaped bash-completed mount point names",
"Description": "In util-linux before 2.32-rc1, bash-completion/umount allows local users to gain privileges by embedding shell commands in a mountpoint name, which is mishandled during a umount command (within Bash) by a different user, as demonstrated by logging in as root and entering umount followed by a tab character for autocompletion.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/103367",
"https://bugs.debian.org/892179",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7738",
"https://github.com/karelzak/util-linux/commit/75f03badd7ed9f1dd951863d75e756883d3acc55",
"https://github.com/karelzak/util-linux/issues/539",
"https://www.debian.org/security/2018/dsa-4134"
]
},
{
"VulnerabilityID": "CVE-2018-16869",
"PkgName": "libnettle6",
"InstalledVersion": "3.4-1",
"Title": "nettle: Leaky data conversion exposing a manager oracle",
"Description": "A Bleichenbacher type side-channel based padding oracle attack was found in the way nettle handles endian conversion of RSA decrypted PKCS#1 v1.5 data. An attacker who is able to run a process on the same physical core as the victim process, could use this flaw extract plaintext or in some cases downgrade any TLS connections to a vulnerable server.",
"Severity": "LOW",
"References": [
"http://cat.eyalro.net/",
"http://www.securityfocus.com/bid/106092",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16869",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16869"
]
},
{
"VulnerabilityID": "CVE-2017-11164",
"PkgName": "libpcre3",
"InstalledVersion": "2:8.39-9",
"Title": "pcre: OP_KETRMAX feature in the match function in pcre_exec.c",
"Description": "In PCRE 8.41, the OP_KETRMAX feature in the match function in pcre_exec.c allows stack exhaustion (uncontrolled recursion) when processing a crafted regular expression.",
"Severity": "HIGH",
"References": [
"http://openwall.com/lists/oss-security/2017/07/11/3",
"http://www.securityfocus.com/bid/99575"
]
},
{
"VulnerabilityID": "CVE-2017-7245",
"PkgName": "libpcre3",
"InstalledVersion": "2:8.39-9",
"Title": "pcre: stack-based buffer overflow write in pcre32_copy_substring",
"Description": "Stack-based buffer overflow in the pcre32_copy_substring function in pcre_get.c in libpcre1 in PCRE 8.40 allows remote attackers to cause a denial of service (WRITE of size 4) or possibly have unspecified other impact via a crafted file.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/97067",
"https://access.redhat.com/errata/RHSA-2018:2486",
"https://blogs.gentoo.org/ago/2017/03/20/libpcre-two-stack-based-buffer-overflow-write-in-pcre32_copy_substring-pcre_get-c/",
"https://security.gentoo.org/glsa/201710-25"
]
},
{
"VulnerabilityID": "CVE-2017-7246",
"PkgName": "libpcre3",
"InstalledVersion": "2:8.39-9",
"Title": "pcre: stack-based buffer overflow write in pcre32_copy_substring",
"Description": "Stack-based buffer overflow in the pcre32_copy_substring function in pcre_get.c in libpcre1 in PCRE 8.40 allows remote attackers to cause a denial of service (WRITE of size 268) or possibly have unspecified other impact via a crafted file.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/97067",
"https://access.redhat.com/errata/RHSA-2018:2486",
"https://blogs.gentoo.org/ago/2017/03/20/libpcre-two-stack-based-buffer-overflow-write-in-pcre32_copy_substring-pcre_get-c/",
"https://security.gentoo.org/glsa/201710-25"
]
},
{
"VulnerabilityID": "CVE-2018-7738",
"PkgName": "libsmartcols1",
"InstalledVersion": "2.31.1-0.4ubuntu3.3",
"Title": "util-linux: Shell command injection in unescaped bash-completed mount point names",
"Description": "In util-linux before 2.32-rc1, bash-completion/umount allows local users to gain privileges by embedding shell commands in a mountpoint name, which is mishandled during a umount command (within Bash) by a different user, as demonstrated by logging in as root and entering umount followed by a tab character for autocompletion.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/103367",
"https://bugs.debian.org/892179",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7738",
"https://github.com/karelzak/util-linux/commit/75f03badd7ed9f1dd951863d75e756883d3acc55",
"https://github.com/karelzak/util-linux/issues/539",
"https://www.debian.org/security/2018/dsa-4134"
]
},
{
"VulnerabilityID": "CVE-2019-5094",
"PkgName": "libss2",
"InstalledVersion": "1.44.1-1ubuntu1.1",
"FixedVersion": "1.44.1-1ubuntu1.2",
"Description": "An exploitable code execution vulnerability exists in the quota file functionality of E2fsprogs 1.45.3. A specially crafted ext4 partition can cause an out-of-bounds write on the heap, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
"Severity": "MEDIUM",
"References": [
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5094",
"https://lists.debian.org/debian-lts-announce/2019/09/msg00029.html",
"https://seclists.org/bugtraq/2019/Sep/58",
"https://talosintelligence.com/vulnerability_reports/TALOS-2019-0887",
"https://usn.ubuntu.com/4142-2/",
"https://www.debian.org/security/2019/dsa-4535"
]
},
{
"VulnerabilityID": "CVE-2018-20839",
"PkgName": "libsystemd0",
"InstalledVersion": "237-3ubuntu10.25",
"Title": "systemd: mishandling of the current keyboard mode check leading to passwords being disclosed in cleartext to attacker",
"Description": "systemd 242 changes the VT1 mode upon a logout, which allows attackers to read cleartext passwords in certain circumstances, such as watching a shutdown, or using Ctrl-Alt-F1 and Ctrl-Alt-F2. This occurs because the KDGKBMODE (aka current keyboard mode) check is mishandled.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/108389",
"https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1803993",
"https://github.com/systemd/systemd/commit/9725f1a10f80f5e0ae7d9b60547458622aeb322f",
"https://github.com/systemd/systemd/pull/12378",
"https://security.netapp.com/advisory/ntap-20190530-0002/"
]
},
{
"VulnerabilityID": "CVE-2019-3843",
"PkgName": "libsystemd0",
"InstalledVersion": "237-3ubuntu10.25",
"Title": "systemd: services with DynamicUser can create SUID/SGID binaries",
"Description": "It was discovered that a systemd service that uses DynamicUser property can create a SUID/SGID binary that would be allowed to run as the transient service UID/GID even after the service is terminated. A local attacker may use this flaw to access resources that will be owned by a potentially different service in the future, when the UID/GID will be recycled.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/108116",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3843",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5JXQAKSTMABZ46EVCRMW62DHWYHTTFES/",
"https://security.netapp.com/advisory/ntap-20190619-0002/"
]
},
{
"VulnerabilityID": "CVE-2019-3844",
"PkgName": "libsystemd0",
"InstalledVersion": "237-3ubuntu10.25",
"Title": "systemd: services with DynamicUser can get new privileges and create SGID binaries",
"Description": "It was discovered that a systemd service that uses DynamicUser property can get new privileges through the execution of SUID binaries, which would allow to create binaries owned by the service transient group with the setgid bit set. A local attacker may use this flaw to access resources that will be owned by a potentially different service in the future, when the GID will be recycled.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/108096",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3844",
"https://security.netapp.com/advisory/ntap-20190619-0002/"
]
},
{
"VulnerabilityID": "CVE-2019-15718",
"PkgName": "libsystemd0",
"InstalledVersion": "237-3ubuntu10.25",
"FixedVersion": "237-3ubuntu10.28",
"Title": "systemd: systemd-resolved allows unprivileged users to configure DNS",
"Description": "In systemd 240, bus_open_system_watch_bind_with_description in shared/bus-util.c (as used by systemd-resolved to connect to the system D-Bus instance), calls sd_bus_set_trusted, which disables access controls for incoming D-Bus messages. An unprivileged user can exploit this by executing D-Bus methods that should be restricted to privileged users, in order to change the system's DNS resolver settings.",
"Severity": "LOW",
"References": [
"http://www.openwall.com/lists/oss-security/2019/09/03/1",
"https://bugzilla.redhat.com/show_bug.cgi?id=1746057",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BRE5IS24XTF5WNZGH2L7GSQJKARBOEGL/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HIKGKXZ5OEGOEYURHLJHEMFYNLEGAW5B/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U2WNHRJW4XI6H5YMDG4BUFGPAXWUMUVG/"
]
},
{
"VulnerabilityID": "CVE-2018-1000654",
"PkgName": "libtasn1-6",
"InstalledVersion": "4.13-2",
"Title": "libtasn1: Infinite loop in _asn1_expand_object_id(ptree) leads to memory exhaustion",
"Description": "GNU Libtasn1-4.13 libtasn1-4.13 version libtasn1-4.13, libtasn1-4.12 contains a DoS, specifically CPU usage will reach 100% when running asn1Paser against the POC due to an issue in _asn1_expand_object_id(p_tree), after a long time, the program will be killed. This attack appears to be exploitable via parsing a crafted file.",
"Severity": "HIGH",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00009.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00018.html",
"http://www.securityfocus.com/bid/105151",
"https://gitlab.com/gnutls/libtasn1/issues/4"
]
},
{
"VulnerabilityID": "CVE-2018-20839",
"PkgName": "libudev1",
"InstalledVersion": "237-3ubuntu10.25",
"Title": "systemd: mishandling of the current keyboard mode check leading to passwords being disclosed in cleartext to attacker",
"Description": "systemd 242 changes the VT1 mode upon a logout, which allows attackers to read cleartext passwords in certain circumstances, such as watching a shutdown, or using Ctrl-Alt-F1 and Ctrl-Alt-F2. This occurs because the KDGKBMODE (aka current keyboard mode) check is mishandled.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/108389",
"https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1803993",
"https://github.com/systemd/systemd/commit/9725f1a10f80f5e0ae7d9b60547458622aeb322f",
"https://github.com/systemd/systemd/pull/12378",
"https://security.netapp.com/advisory/ntap-20190530-0002/"
]
},
{
"VulnerabilityID": "CVE-2019-3843",
"PkgName": "libudev1",
"InstalledVersion": "237-3ubuntu10.25",
"Title": "systemd: services with DynamicUser can create SUID/SGID binaries",
"Description": "It was discovered that a systemd service that uses DynamicUser property can create a SUID/SGID binary that would be allowed to run as the transient service UID/GID even after the service is terminated. A local attacker may use this flaw to access resources that will be owned by a potentially different service in the future, when the UID/GID will be recycled.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/108116",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3843",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5JXQAKSTMABZ46EVCRMW62DHWYHTTFES/",
"https://security.netapp.com/advisory/ntap-20190619-0002/"
]
},
{
"VulnerabilityID": "CVE-2019-3844",
"PkgName": "libudev1",
"InstalledVersion": "237-3ubuntu10.25",
"Title": "systemd: services with DynamicUser can get new privileges and create SGID binaries",
"Description": "It was discovered that a systemd service that uses DynamicUser property can get new privileges through the execution of SUID binaries, which would allow to create binaries owned by the service transient group with the setgid bit set. A local attacker may use this flaw to access resources that will be owned by a potentially different service in the future, when the GID will be recycled.",
"Severity": "MEDIUM",
"References": [
"http://www.securityfocus.com/bid/108096",
"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3844",
"https://security.netapp.com/advisory/ntap-20190619-0002/"
]
},
{
"VulnerabilityID": "CVE-2019-15718",
"PkgName": "libudev1",
"InstalledVersion": "237-3ubuntu10.25",
"FixedVersion": "237-3ubuntu10.28",
"Title": "systemd: systemd-resolved allows unprivileged users to configure DNS",
"Description": "In systemd 240, bus_open_system_watch_bind_with_description in shared/bus-util.c (as used by systemd-resolved to connect to the system D-Bus instance), calls sd_bus_set_trusted, which disables access controls for incoming D-Bus messages. An unprivileged user can exploit this by executing D-Bus methods that should be restricted to privileged users, in order to change the system's DNS resolver settings.",
"Severity": "LOW",
"References": [
"http://www.openwall.com/lists/oss-security/2019/09/03/1",
"https://bugzilla.redhat.com/show_bug.cgi?id=1746057",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BRE5IS24XTF5WNZGH2L7GSQJKARBOEGL/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HIKGKXZ5OEGOEYURHLJHEMFYNLEGAW5B/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U2WNHRJW4XI6H5YMDG4BUFGPAXWUMUVG/"
]
},
{
"VulnerabilityID": "CVE-2018-7738",
"PkgName": "libuuid1",
"InstalledVersion": "2.31.1-0.4ubuntu3.3",
"Title": "util-linux: Shell command injection in unescaped bash-completed mount point names",
"Description": "In util-linux before 2.32-rc1, bash-completion/umount allows local users to gain privileges by embedding shell commands in a mountpoint name, which is mishandled during a umount command (within Bash) by a different user, as demonstrated by logging in as root and entering umount followed by a tab character for autocompletion.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/103367",
"https://bugs.debian.org/892179",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7738",
"https://github.com/karelzak/util-linux/commit/75f03badd7ed9f1dd951863d75e756883d3acc55",
"https://github.com/karelzak/util-linux/issues/539",
"https://www.debian.org/security/2018/dsa-4134"
]
},
{
"VulnerabilityID": "CVE-2019-11922",
"PkgName": "libzstd1",
"InstalledVersion": "1.3.3+dfsg-2ubuntu1",
"FixedVersion": "1.3.3+dfsg-2ubuntu1.1",
"Description": "A race condition in the one-pass compression functions of Zstandard prior to version 1.3.8 could allow an attacker to write bytes out of bounds if an output buffer smaller than the recommended size was used.",
"Severity": "MEDIUM",
"References": [
"http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00008.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00062.html",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11922",
"https://github.com/facebook/zstd/pull/1404/commits/3e5cdf1b6a85843e991d7d10f6a2567c15580da0",
"https://www.facebook.com/security/advisories/cve-2019-11922"
]
},
{
"VulnerabilityID": "CVE-2018-7169",
"PkgName": "login",
"InstalledVersion": "1:4.5-1ubuntu2",
"Title": "shadow-utils: newgidmap allows unprivileged user to drop supplementary groups potentially allowing privilege escalation",
"Description": "An issue was discovered in shadow 4.5. newgidmap (in shadow-utils) is setuid and allows an unprivileged user to be placed in a user namespace where setgroups(2) is permitted. This allows an attacker to remove themselves from a supplementary group, which may allow access to certain filesystem paths if the administrator has used \"group blacklisting\" (e.g., chmod g-rwx) to restrict access to paths. This flaw effectively reverts a security feature in the kernel (in particular, the /proc/self/setgroups knob) to prevent this sort of privilege escalation.",
"Severity": "MEDIUM",
"References": [
"https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1729357",
"https://security.gentoo.org/glsa/201805-09"
]
},
{
"VulnerabilityID": "CVE-2013-4235",
"PkgName": "login",
"InstalledVersion": "1:4.5-1ubuntu2",
"Title": "shadow-utils: TOCTOU race conditions by copying and removing directory trees",
"Description": "A TOCTOU race condition was discovered in shadow-utils. A local attacker with write privileges in a directory removed or copied by usermod/userdel could potentially exploit this flaw, when the administrator invokes usermod/userdel, to delete or modify other files on the system.",
"Severity": "LOW"
},
{
"VulnerabilityID": "CVE-2018-7738",
"PkgName": "mount",
"InstalledVersion": "2.31.1-0.4ubuntu3.3",
"Title": "util-linux: Shell command injection in unescaped bash-completed mount point names",
"Description": "In util-linux before 2.32-rc1, bash-completion/umount allows local users to gain privileges by embedding shell commands in a mountpoint name, which is mishandled during a umount command (within Bash) by a different user, as demonstrated by logging in as root and entering umount followed by a tab character for autocompletion.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/103367",
"https://bugs.debian.org/892179",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7738",
"https://github.com/karelzak/util-linux/commit/75f03badd7ed9f1dd951863d75e756883d3acc55",
"https://github.com/karelzak/util-linux/issues/539",
"https://www.debian.org/security/2018/dsa-4134"
]
},
{
"VulnerabilityID": "CVE-2018-7169",
"PkgName": "passwd",
"InstalledVersion": "1:4.5-1ubuntu2",
"Title": "shadow-utils: newgidmap allows unprivileged user to drop supplementary groups potentially allowing privilege escalation",
"Description": "An issue was discovered in shadow 4.5. newgidmap (in shadow-utils) is setuid and allows an unprivileged user to be placed in a user namespace where setgroups(2) is permitted. This allows an attacker to remove themselves from a supplementary group, which may allow access to certain filesystem paths if the administrator has used \"group blacklisting\" (e.g., chmod g-rwx) to restrict access to paths. This flaw effectively reverts a security feature in the kernel (in particular, the /proc/self/setgroups knob) to prevent this sort of privilege escalation.",
"Severity": "MEDIUM",
"References": [
"https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1729357",
"https://security.gentoo.org/glsa/201805-09"
]
},
{
"VulnerabilityID": "CVE-2013-4235",
"PkgName": "passwd",
"InstalledVersion": "1:4.5-1ubuntu2",
"Title": "shadow-utils: TOCTOU race conditions by copying and removing directory trees",
"Description": "A TOCTOU race condition was discovered in shadow-utils. A local attacker with write privileges in a directory removed or copied by usermod/userdel could potentially exploit this flaw, when the administrator invokes usermod/userdel, to delete or modify other files on the system.",
"Severity": "LOW"
},
{
"VulnerabilityID": "CVE-2018-20482",
"PkgName": "tar",
"InstalledVersion": "1.29b-2ubuntu0.1",
"Title": "tar: Infinite read loop in sparse_dump_region function in sparse.c",
"Description": "GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).",
"Severity": "LOW",
"References": [
"http://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454",
"http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00023.html",
"http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00077.html",
"http://www.securityfocus.com/bid/106354",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20482",
"https://lists.debian.org/debian-lts-announce/2018/12/msg00023.html",
"https://news.ycombinator.com/item?id=18745431",
"https://security.gentoo.org/glsa/201903-05",
"https://twitter.com/thatcks/status/1076166645708668928",
"https://utcc.utoronto.ca/~cks/space/blog/sysadmin/TarFindingTruncateBug"
]
},
{
"VulnerabilityID": "CVE-2018-7738",
"PkgName": "util-linux",
"InstalledVersion": "2.31.1-0.4ubuntu3.3",
"Title": "util-linux: Shell command injection in unescaped bash-completed mount point names",
"Description": "In util-linux before 2.32-rc1, bash-completion/umount allows local users to gain privileges by embedding shell commands in a mountpoint name, which is mishandled during a umount command (within Bash) by a different user, as demonstrated by logging in as root and entering umount followed by a tab character for autocompletion.",
"Severity": "HIGH",
"References": [
"http://www.securityfocus.com/bid/103367",
"https://bugs.debian.org/892179",
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7738",
"https://github.com/karelzak/util-linux/commit/75f03badd7ed9f1dd951863d75e756883d3acc55",
"https://github.com/karelzak/util-linux/issues/539",
"https://www.debian.org/security/2018/dsa-4134"
]
}
]
}
]

164
pkg/app.go Normal file
View File

@@ -0,0 +1,164 @@
package pkg
import (
"strings"
"time"
"github.com/aquasecurity/trivy/pkg/vulnerability"
"github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/urfave/cli"
)
func NewApp(version string) *cli.App {
cli.AppHelpTemplate = `NAME:
{{.Name}}{{if .Usage}} - {{.Usage}}{{end}}
USAGE:
{{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Version}}{{if not .HideVersion}}
VERSION:
{{.Version}}{{end}}{{end}}{{if .Description}}
DESCRIPTION:
{{.Description}}{{end}}{{if len .Authors}}
AUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}:
{{range $index, $author := .Authors}}{{if $index}}
{{end}}{{$author}}{{end}}{{end}}{{if .VisibleCommands}}
OPTIONS:
{{range $index, $option := .VisibleFlags}}{{if $index}}
{{end}}{{$option}}{{end}}{{end}}
`
app := cli.NewApp()
app.Name = "trivy"
app.Version = version
app.ArgsUsage = "image_name"
app.Usage = "A simple and comprehensive vulnerability scanner for containers"
app.EnableBashCompletion = true
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "template, t",
Value: "",
Usage: "output template",
EnvVar: "TRIVY_TEMPLATE",
},
cli.StringFlag{
Name: "format, f",
Value: "table",
Usage: "format (table, json, template)",
EnvVar: "TRIVY_FORMAT",
},
cli.StringFlag{
Name: "input, i",
Value: "",
Usage: "input file path instead of image name",
EnvVar: "TRIVY_INPUT",
},
cli.StringFlag{
Name: "severity, s",
Value: strings.Join(types.SeverityNames, ","),
Usage: "severities of vulnerabilities to be displayed (comma separated)",
EnvVar: "TRIVY_SEVERITY",
},
cli.StringFlag{
Name: "output, o",
Usage: "output file name",
EnvVar: "TRIVY_OUTPUT",
},
cli.IntFlag{
Name: "exit-code",
Usage: "Exit code when vulnerabilities were found",
Value: 0,
EnvVar: "TRIVY_EXIT_CODE",
},
cli.BoolFlag{
Name: "skip-update",
Usage: "skip db update",
EnvVar: "TRIVY_SKIP_UPDATE",
},
cli.BoolFlag{
Name: "download-db-only",
Usage: "download/update vulnerability database but don't run a scan",
EnvVar: "TRIVY_DOWNLOAD_DB_ONLY",
},
cli.BoolFlag{
Name: "reset",
Usage: "remove all caches and database",
EnvVar: "TRIVY_RESET",
},
cli.BoolFlag{
Name: "clear-cache, c",
Usage: "clear image caches",
EnvVar: "TRIVY_CLEAR_CACHE",
},
cli.BoolFlag{
Name: "quiet, q",
Usage: "suppress progress bar and log output",
EnvVar: "TRIVY_QUIET",
},
cli.BoolFlag{
Name: "no-progress",
Usage: "suppress progress bar",
EnvVar: "TRIVY_NO_PROGRESS",
},
cli.BoolFlag{
Name: "ignore-unfixed",
Usage: "display only fixed vulnerabilities",
EnvVar: "TRIVY_IGNORE_UNFIXED",
},
cli.BoolFlag{
Name: "debug, d",
Usage: "debug mode",
EnvVar: "TRIVY_DEBUG",
},
cli.StringFlag{
Name: "vuln-type",
Value: "os,library",
Usage: "comma-separated list of vulnerability types (os,library)",
EnvVar: "TRIVY_VULN_TYPE",
},
cli.StringFlag{
Name: "cache-dir",
Value: utils.DefaultCacheDir(),
Usage: "use as cache directory, but image cache is stored in /path/to/cache/fanal",
EnvVar: "TRIVY_CACHE_DIR",
},
cli.StringFlag{
Name: "ignorefile",
Value: vulnerability.DefaultIgnoreFile,
Usage: "specify .trivyignore file",
EnvVar: "TRIVY_IGNOREFILE",
},
cli.DurationFlag{
Name: "timeout",
Value: time.Second * 60,
Usage: "docker timeout",
EnvVar: "TRIVY_TIMEOUT",
},
cli.BoolFlag{
Name: "light",
Usage: "light mode: it's faster, but vulnerability descriptions and references are not displayed",
},
// deprecated options
cli.StringFlag{
Name: "only-update",
Usage: "deprecated",
EnvVar: "TRIVY_ONLY_UPDATE",
},
cli.BoolFlag{
Name: "refresh",
Usage: "deprecated",
EnvVar: "TRIVY_REFRESH",
},
cli.BoolFlag{
Name: "auto-refresh",
Usage: "deprecated",
EnvVar: "TRIVY_AUTO_REFRESH",
},
}
app.Action = Run
return app
}

View File

@@ -1,158 +1,136 @@
package db
import (
"encoding/json"
"compress/gzip"
"context"
"io"
"os"
"path/filepath"
"github.com/aquasecurity/trivy/pkg/log"
"k8s.io/utils/clock"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy-db/pkg/db"
"github.com/aquasecurity/trivy/pkg/github"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/utils"
bolt "github.com/etcd-io/bbolt"
)
var (
db *bolt.DB
dbDir string
const (
fullDB = "trivy.db.gz"
lightDB = "trivy-light.db.gz"
)
func Init() (err error) {
dbDir = filepath.Join(utils.CacheDir(), "db")
if err = os.MkdirAll(dbDir, 0700); err != nil {
return xerrors.Errorf("failed to mkdir: %w", err)
type Operation interface {
GetMetadata() (db.Metadata, error)
}
type GitHubOperation interface {
DownloadDB(ctx context.Context, fileName string) (io.ReadCloser, error)
}
type Client struct {
dbc Operation
clock clock.Clock
githubClient GitHubOperation
}
func NewClient() Client {
return Client{
dbc: db.Config{},
clock: clock.RealClock{},
githubClient: github.NewClient(),
}
}
func (c Client) Download(ctx context.Context, cliVersion, cacheDir string, light, skip bool) error {
dbType := db.TypeFull
dbFile := fullDB
message := " Downloading Full DB file..."
if light {
dbFile = lightDB
message = " Downloading Lightweight DB file..."
dbType = db.TypeLight
}
dbPath := filepath.Join(dbDir, "trivy.db")
log.Logger.Debugf("db path: %s", dbPath)
db, err = bolt.Open(dbPath, 0600, nil)
metadata, err := c.dbc.GetMetadata()
if err != nil {
return xerrors.Errorf("failed to open db: %w", err)
}
return nil
}
func Close() error {
if err := db.Close(); err != nil {
return xerrors.Errorf("failed to close DB: %w", err)
}
return nil
}
func Reset() error {
if err := Close(); err != nil {
return xerrors.Errorf("failed to reset DB: %w", err)
}
if err := os.RemoveAll(dbDir); err != nil {
return xerrors.Errorf("failed to reset DB: %w", err)
}
if err := Init(); err != nil {
return xerrors.Errorf("failed to reset DB: %w", err)
}
return nil
}
func GetVersion() string {
var version string
value, err := Get("trivy", "metadata", "version")
if err != nil {
return ""
}
if err = json.Unmarshal(value, &version); err != nil {
return ""
}
return version
}
func SetVersion(version string) error {
err := Update("trivy", "metadata", "version", version)
if err != nil {
return xerrors.Errorf("failed to save DB version: %w", err)
}
return nil
}
func Update(rootBucket, nestedBucket, key string, value interface{}) error {
err := db.Update(func(tx *bolt.Tx) error {
return PutNestedBucket(tx, rootBucket, nestedBucket, key, value)
})
if err != nil {
return xerrors.Errorf("error in db update: %w", err)
}
return err
}
func PutNestedBucket(tx *bolt.Tx, rootBucket, nestedBucket, key string, value interface{}) error {
root, err := tx.CreateBucketIfNotExists([]byte(rootBucket))
if err != nil {
return xerrors.Errorf("failed to create a bucket: %w", err)
}
return Put(root, nestedBucket, key, value)
}
func Put(root *bolt.Bucket, nestedBucket, key string, value interface{}) error {
nested, err := root.CreateBucketIfNotExists([]byte(nestedBucket))
if err != nil {
return xerrors.Errorf("failed to create a bucket: %w", err)
}
v, err := json.Marshal(value)
if err != nil {
return xerrors.Errorf("failed to unmarshal JSON: %w", err)
}
return nested.Put([]byte(key), v)
}
func BatchUpdate(fn func(tx *bolt.Tx) error) error {
err := db.Batch(fn)
if err != nil {
return xerrors.Errorf("error in batch update: %w", err)
}
return nil
}
func Get(rootBucket, nestedBucket, key string) (value []byte, err error) {
err = db.View(func(tx *bolt.Tx) error {
root := tx.Bucket([]byte(rootBucket))
if root == nil {
return nil
log.Logger.Debug("This is the first run")
if skip {
log.Logger.Error("The first run cannot skip downloading DB")
return xerrors.New("--skip-update cannot be specified on the first run")
}
nested := root.Bucket([]byte(nestedBucket))
if nested == nil {
return nil
}
value = nested.Get([]byte(key))
return nil
})
if err != nil {
return nil, xerrors.Errorf("failed to get data from db: %w", err)
metadata = db.Metadata{} // suppress a warning
}
return value, nil
}
func ForEach(rootBucket, nestedBucket string) (value map[string][]byte, err error) {
value = map[string][]byte{}
err = db.View(func(tx *bolt.Tx) error {
root := tx.Bucket([]byte(rootBucket))
if root == nil {
return nil
}
nested := root.Bucket([]byte(nestedBucket))
if nested == nil {
return nil
}
err := nested.ForEach(func(k, v []byte) error {
value[string(k)] = v
return nil
})
if err != nil {
return xerrors.Errorf("error in db foreach: %w", err)
if db.SchemaVersion < metadata.Version {
log.Logger.Errorf("Trivy version (%s) is old. Update to the latest version.", cliVersion)
return xerrors.Errorf("the version of DB schema doesn't match. Local DB: %d, Expected: %d",
metadata.Version, db.SchemaVersion)
}
if skip {
if db.SchemaVersion != metadata.Version {
log.Logger.Error("The local DB is old and needs to be updated")
return xerrors.New("--skip-update cannot be specified with the old DB")
} else if metadata.Type != dbType {
if dbType == db.TypeFull {
log.Logger.Error("The local DB is a lightweight DB. You have to download a full DB")
} else {
log.Logger.Error("The local DB is a full DB. You have to download a lightweight DB")
}
return xerrors.New("--skip-update cannot be specified with the different schema DB")
}
return nil
})
if err != nil {
return nil, xerrors.Errorf("failed to get all key/value in the specified bucket: %w", err)
}
return value, nil
if db.SchemaVersion == metadata.Version && metadata.Type == dbType &&
c.clock.Now().Before(metadata.NextUpdate) {
log.Logger.Debug("DB update was skipped because DB is the latest")
return nil
}
if err = c.download(ctx, cacheDir, message, dbFile); err != nil {
return xerrors.Errorf("failed to download the DB file: %w", err)
}
log.Logger.Info("Reopening vulnerability DB")
if err = db.Close(); err != nil {
return xerrors.Errorf("unable to close old DB: %w", err)
}
if err = db.Init(cacheDir); err != nil {
return xerrors.Errorf("unable to open new DB: %w", err)
}
return nil
}
func (c Client) download(ctx context.Context, cacheDir, message, dbFile string) error {
spinner := utils.NewSpinner(message)
spinner.Start()
defer spinner.Stop()
rc, err := c.githubClient.DownloadDB(ctx, dbFile)
if err != nil {
return xerrors.Errorf("failed to download vulnerability DB: %w", err)
}
defer rc.Close()
gr, err := gzip.NewReader(rc)
if err != nil {
return xerrors.Errorf("invalid gzip file: %w", err)
}
dbPath := db.Path(cacheDir)
file, err := os.Create(dbPath)
if err != nil {
return xerrors.Errorf("unable to open DB file: %w", err)
}
defer file.Close()
_, err = io.Copy(file, gr)
if err != nil {
return xerrors.Errorf("failed to save DB file: %w", err)
}
return nil
}

318
pkg/db/db_test.go Normal file
View File

@@ -0,0 +1,318 @@
package db
import (
"context"
"errors"
"io"
"io/ioutil"
"os"
"testing"
"time"
"github.com/stretchr/testify/require"
"golang.org/x/xerrors"
"k8s.io/utils/clock"
clocktesting "k8s.io/utils/clock/testing"
"github.com/aquasecurity/trivy-db/pkg/db"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
type MockConfig struct {
mock.Mock
}
func (_m *MockConfig) GetMetadata() (db.Metadata, error) {
ret := _m.Called()
ret0 := ret.Get(0)
if ret0 == nil {
return db.Metadata{}, ret.Error(1)
}
metadata, ok := ret0.(db.Metadata)
if !ok {
return db.Metadata{}, ret.Error(1)
}
return metadata, ret.Error(1)
}
type MockGitHubClient struct {
mock.Mock
}
func (_m *MockGitHubClient) DownloadDB(ctx context.Context, fileName string) (io.ReadCloser, error) {
ret := _m.Called(ctx, fileName)
ret0 := ret.Get(0)
if ret0 == nil {
return nil, ret.Error(1)
}
rc, ok := ret0.(io.ReadCloser)
if !ok {
return nil, ret.Error(1)
}
return rc, ret.Error(1)
}
func TestClient_Download(t *testing.T) {
type getMetadataOutput struct {
metadata db.Metadata
err error
}
type downloadDBOutput struct {
fileName string
err error
}
type downloadDB struct {
input string
output downloadDBOutput
}
testCases := []struct {
name string
light bool
skip bool
clock clock.Clock
getMetadata getMetadataOutput
downloadDB []downloadDB
expectedContent []byte
expectedError error
}{
{
name: "happy path",
light: false,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{
Version: 1,
Type: db.TypeFull,
NextUpdate: time.Date(2019, 9, 1, 0, 0, 0, 0, time.UTC),
},
},
downloadDB: []downloadDB{
{
input: fullDB,
output: downloadDBOutput{
fileName: "testdata/test.db.gz",
},
},
},
},
{
name: "happy path for first run",
light: false,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{},
err: errors.New("get metadata failed"),
},
downloadDB: []downloadDB{
{
input: fullDB,
output: downloadDBOutput{
fileName: "testdata/test.db.gz",
},
},
},
},
{
name: "happy path with different type",
light: true,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{
Version: 1,
Type: db.TypeFull,
NextUpdate: time.Date(2019, 9, 1, 0, 0, 0, 0, time.UTC),
},
},
downloadDB: []downloadDB{
{
input: lightDB,
output: downloadDBOutput{
fileName: "testdata/test.db.gz",
},
},
},
},
{
name: "happy path with old schema version",
light: true,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{
Version: 0,
Type: db.TypeFull,
NextUpdate: time.Date(2020, 9, 1, 0, 0, 0, 0, time.UTC),
},
},
downloadDB: []downloadDB{
{
input: lightDB,
output: downloadDBOutput{
fileName: "testdata/test.db.gz",
},
},
},
},
{
name: "happy path with --skip-update",
light: false,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{
Version: 1,
Type: db.TypeFull,
NextUpdate: time.Date(2019, 9, 1, 0, 0, 0, 0, time.UTC),
},
},
skip: true,
},
{
name: "skip downloading DB",
light: false,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{
Version: 1,
Type: db.TypeFull,
NextUpdate: time.Date(2019, 10, 2, 0, 0, 0, 0, time.UTC),
},
},
},
{
name: "newer schema version",
light: false,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{
Version: 2,
Type: db.TypeFull,
NextUpdate: time.Date(2019, 10, 2, 0, 0, 0, 0, time.UTC),
},
},
expectedError: xerrors.New("the version of DB schema doesn't match. Local DB: 2, Expected: 1"),
},
{
name: "DownloadDB returns an error",
light: false,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{
Version: 1,
Type: db.TypeFull,
NextUpdate: time.Date(2019, 9, 1, 0, 0, 0, 0, time.UTC),
},
},
downloadDB: []downloadDB{
{
input: fullDB,
output: downloadDBOutput{
err: xerrors.New("download failed"),
},
},
},
expectedError: xerrors.New("failed to download the DB file: failed to download vulnerability DB: download failed"),
},
{
name: "invalid gzip",
light: false,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{
Version: 1,
Type: db.TypeFull,
NextUpdate: time.Date(2019, 9, 1, 0, 0, 0, 0, time.UTC),
},
},
downloadDB: []downloadDB{
{
input: fullDB,
output: downloadDBOutput{
fileName: "testdata/invalid.db.gz",
},
},
},
expectedError: xerrors.New("unable to open new DB: failed to open db: invalid database"),
},
{
name: "--skip-update on the first run",
light: false,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
err: xerrors.New("this is the first run"),
},
skip: true,
expectedError: xerrors.New("--skip-update cannot be specified on the first run"),
},
{
name: "--skip-update with different schema version",
light: false,
clock: clocktesting.NewFakeClock(time.Date(2019, 10, 1, 0, 0, 0, 0, time.UTC)),
getMetadata: getMetadataOutput{
metadata: db.Metadata{
Version: 0,
Type: db.TypeFull,
NextUpdate: time.Date(2019, 9, 1, 0, 0, 0, 0, time.UTC),
},
},
skip: true,
expectedError: xerrors.New("--skip-update cannot be specified with the old DB"),
},
}
if err := log.InitLogger(false, true); err != nil {
require.NoError(t, err, "failed to init logger")
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
mockConfig := new(MockConfig)
mockConfig.On("GetMetadata").Return(
tc.getMetadata.metadata, tc.getMetadata.err)
mockGitHubConfig := new(MockGitHubClient)
for _, dd := range tc.downloadDB {
var rc io.ReadCloser
if dd.output.fileName != "" {
f, err := os.Open(dd.output.fileName)
assert.NoError(t, err, tc.name)
rc = f
}
mockGitHubConfig.On("DownloadDB", mock.Anything, dd.input).Return(
rc, dd.output.err,
)
}
dir, err := ioutil.TempDir("", "db")
require.NoError(t, err, tc.name)
defer os.RemoveAll(dir)
err = db.Init(dir)
require.NoError(t, err, tc.name)
client := Client{
dbc: mockConfig,
clock: tc.clock,
githubClient: mockGitHubConfig,
}
ctx := context.Background()
err = client.Download(ctx, "test", dir, tc.light, tc.skip)
switch {
case tc.expectedError != nil:
assert.EqualError(t, err, tc.expectedError.Error(), tc.name)
default:
assert.NoError(t, err, tc.name)
}
mockConfig.AssertExpectations(t)
mockGitHubConfig.AssertExpectations(t)
})
}
}

BIN
pkg/db/testdata/invalid.db.gz vendored Normal file

Binary file not shown.

BIN
pkg/db/testdata/test.db.gz vendored Normal file

Binary file not shown.

View File

@@ -1,194 +0,0 @@
package git
import (
"os"
"path/filepath"
"strings"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/utils"
"golang.org/x/xerrors"
git "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"gopkg.in/src-d/go-git.v4/plumbing/storer"
)
func CloneOrPull(url, repoPath string) (map[string]struct{}, error) {
exists, err := utils.Exists(filepath.Join(repoPath, ".git"))
if err != nil {
return nil, xerrors.Errorf("failed to check if a file exists: %w", err)
}
updatedFiles := map[string]struct{}{}
if exists {
log.Logger.Debug("git pull")
files, err := pull(repoPath)
if err != nil {
return nil, xerrors.Errorf("failed to pull repository: %w", err)
}
for _, filename := range files {
updatedFiles[strings.TrimSpace(filename)] = struct{}{}
}
} else {
if !utils.IsCommandAvailable("git") {
log.Logger.Warn("Recommend installing git (if not, DB update is very slow)")
}
log.Logger.Debug("remove an existed directory")
suffix := " It will take a while for the first time..."
s := utils.NewSpinner(suffix)
s.Start()
defer s.Stop()
if err = os.RemoveAll(repoPath); err != nil {
return nil, xerrors.Errorf("failed to remove an existed directory: %w", err)
}
if err = os.MkdirAll(repoPath, 0700); err != nil {
return nil, xerrors.Errorf("failed to mkdir: %w", err)
}
if err := clone(url, repoPath); err != nil {
return nil, xerrors.Errorf("failed to clone repository: %w", err)
}
}
// Need to refresh all vulnerabilities
if db.GetVersion() == "" {
err = filepath.Walk(repoPath, func(path string, info os.FileInfo, err error) error {
if info.IsDir() {
return nil
}
rel, err := filepath.Rel(repoPath, path)
if err != nil {
return xerrors.Errorf("failed to get a relative path: %w", err)
}
updatedFiles[rel] = struct{}{}
return nil
})
if err != nil {
return nil, xerrors.Errorf("error in file walk: %w", err)
}
}
return updatedFiles, nil
}
func clone(url, repoPath string) error {
if utils.IsCommandAvailable("git") {
return cloneByOSCommand(url, repoPath)
}
_, err := git.PlainClone(repoPath, false, &git.CloneOptions{
URL: url,
})
if err != nil && err != git.ErrRepositoryAlreadyExists {
return xerrors.Errorf("unexpected error in git clone: %w", err)
}
return nil
}
func cloneByOSCommand(url, repoPath string) error {
commandAndArgs := []string{"clone", "--depth=1", url, repoPath}
_, err := utils.Exec("git", commandAndArgs)
if err != nil {
return xerrors.Errorf("error in git clone: %w", err)
}
return nil
}
func pull(repoPath string) ([]string, error) {
if utils.IsCommandAvailable("git") {
return pullByOSCommand(repoPath)
}
r, err := git.PlainOpen(repoPath)
if err != nil {
return nil, xerrors.Errorf("failed to open repository: %w", err)
}
log.Logger.Debug("Retrieve the branch being pointed by HEAD")
ref, err := r.Head()
if err != nil {
return nil, xerrors.Errorf("failed to get HEAD: %w", err)
}
log.Logger.Debug("Get the working directory for the repository")
w, err := r.Worktree()
if err != nil {
return nil, xerrors.Errorf("failed to get the working directory: %w", err)
}
log.Logger.Debug("Pull the latest changes from the origin remote and merge into the current branch")
err = w.Pull(&git.PullOptions{RemoteName: "origin"})
if err != nil && err != git.NoErrAlreadyUpToDate {
return nil, err
} else if err == git.NoErrAlreadyUpToDate {
return []string{}, nil
}
log.Logger.Debug("Retrieve the commit history")
commits, err := r.Log(&git.LogOptions{})
if err != nil {
return nil, xerrors.Errorf("error in git log: %w", err)
}
log.Logger.Debug("Detect the updated files")
var prevCommit *object.Commit
var updatedFiles []string
err = commits.ForEach(func(commit *object.Commit) error {
if prevCommit == nil {
prevCommit = commit
return nil
}
patch, err := commit.Patch(prevCommit)
if err != nil {
return xerrors.Errorf("error in patch: %w", err)
}
for _, stat := range patch.Stats() {
updatedFiles = append(updatedFiles, stat.Name)
}
if commit.Hash == ref.Hash() {
return storer.ErrStop
}
prevCommit = commit
return nil
})
if err != nil {
return nil, xerrors.Errorf("error in commit foreach: %w", err)
}
return updatedFiles, nil
}
func pullByOSCommand(repoPath string) ([]string, error) {
gitDir := filepath.Join(repoPath, ".git")
commandArgs := []string{"--git-dir", gitDir, "--work-tree", repoPath}
revParseCmd := []string{"rev-parse", "HEAD"}
output, err := utils.Exec("git", append(commandArgs, revParseCmd...))
if err != nil {
return nil, xerrors.Errorf("error in git rev-parse: %w", err)
}
commitHash := strings.TrimSpace(output)
pullCmd := []string{"pull", "origin", "master"}
_, err = utils.Exec("git", append(commandArgs, pullCmd...))
if err != nil {
return nil, xerrors.Errorf("error in git pull: %w", err)
}
diffCmd := []string{"diff", commitHash, "HEAD", "--name-only"}
output, err = utils.Exec("git", append(commandArgs, diffCmd...))
if err != nil {
return nil, xerrors.Errorf("error in git diff: %w", err)
}
updatedFiles := strings.Split(strings.TrimSpace(output), "\n")
return updatedFiles, nil
}

113
pkg/github/github.go Normal file
View File

@@ -0,0 +1,113 @@
package github
import (
"context"
"fmt"
"io"
"net/http"
"sort"
"strings"
"github.com/aquasecurity/trivy-db/pkg/db"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/google/go-github/v28/github"
"golang.org/x/xerrors"
)
const (
owner = "aquasecurity"
repo = "trivy-db"
)
type RepositoryInterface interface {
ListReleases(ctx context.Context, opt *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error)
DownloadAsset(ctx context.Context, id int64) (io.ReadCloser, string, error)
}
type Repository struct {
repository *github.RepositoriesService
git *github.GitService
owner string
repoName string
}
func (r Repository) ListReleases(ctx context.Context, opt *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error) {
return r.repository.ListReleases(ctx, r.owner, r.repoName, opt)
}
func (r Repository) DownloadAsset(ctx context.Context, id int64) (io.ReadCloser, string, error) {
return r.repository.DownloadReleaseAsset(ctx, r.owner, r.repoName, id)
}
type Client struct {
Repository RepositoryInterface
}
func NewClient() Client {
gc := github.NewClient(nil)
repo := Repository{
repository: gc.Repositories,
git: gc.Git,
owner: owner,
repoName: repo,
}
return Client{
Repository: repo,
}
}
func (c Client) DownloadDB(ctx context.Context, fileName string) (io.ReadCloser, error) {
options := github.ListOptions{}
releases, _, err := c.Repository.ListReleases(ctx, &options)
if err != nil {
return nil, xerrors.Errorf("failed to list releases: %w", err)
}
sort.Slice(releases, func(i, j int) bool {
return releases[i].GetPublishedAt().After(releases[j].GetPublishedAt().Time)
})
prefix := fmt.Sprintf("v%d", db.SchemaVersion)
for _, release := range releases {
log.Logger.Debugf("release name: %s", release.GetName())
if !strings.HasPrefix(release.GetName(), prefix) {
continue
}
for _, asset := range release.Assets {
rc, err := c.downloadAsset(ctx, asset, fileName)
if err != nil {
log.Logger.Debug(err)
continue
}
return rc, nil
}
}
return nil, xerrors.New("DB file not found")
}
func (c Client) downloadAsset(ctx context.Context, asset github.ReleaseAsset, fileName string) (io.ReadCloser, error) {
log.Logger.Debugf("asset name: %s", asset.GetName())
if asset.GetName() != fileName {
return nil, xerrors.New("file name doesn't match")
}
rc, url, err := c.Repository.DownloadAsset(ctx, asset.GetID())
if err != nil {
return nil, xerrors.Errorf("unable to download the asset: %w", err)
}
if rc != nil {
return rc, nil
}
log.Logger.Debugf("asset URL: %s", url)
resp, err := http.Get(url)
if err != nil || resp.StatusCode != http.StatusOK {
return nil, xerrors.Errorf("unable to download the asset via URL: %w", err)
}
return resp.Body, nil
}

467
pkg/github/github_test.go Normal file
View File

@@ -0,0 +1,467 @@
package github
import (
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"net/url"
"path"
"strings"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/aquasecurity/trivy/pkg/log"
"golang.org/x/xerrors"
"github.com/stretchr/testify/assert"
"github.com/google/go-github/v28/github"
"github.com/stretchr/testify/mock"
)
type MockRepository struct {
mock.Mock
}
func (_m *MockRepository) ListReleases(ctx context.Context, opt *github.ListOptions) (
[]*github.RepositoryRelease, *github.Response, error) {
ret := _m.Called(ctx, opt)
ret0 := ret.Get(0)
if ret0 == nil {
return nil, nil, ret.Error(2)
}
releases, ok := ret0.([]*github.RepositoryRelease)
if !ok {
return nil, nil, ret.Error(2)
}
return releases, nil, ret.Error(2)
}
func (_m *MockRepository) DownloadAsset(ctx context.Context, id int64) (io.ReadCloser, string, error) {
ret := _m.Called(ctx, id)
ret0 := ret.Get(0)
if ret0 == nil {
return nil, ret.String(1), ret.Error(2)
}
rc, ok := ret0.(io.ReadCloser)
if !ok {
return nil, ret.String(1), ret.Error(2)
}
return rc, ret.String(1), ret.Error(2)
}
func TestClient_DownloadDB(t *testing.T) {
type listReleasesOutput struct {
releases []*github.RepositoryRelease
response *github.Response
err error
}
type listReleases struct {
input string
output listReleasesOutput
}
type downloadAssetOutput struct {
rc io.ReadCloser
redirectPath string
err error
}
type downloadAsset struct {
input int64
output downloadAssetOutput
}
testCases := []struct {
name string
fileName string
filePaths []string
listReleases []listReleases
downloadAsset []downloadAsset
expectedError error
}{
{
name: "happy path",
fileName: "trivy.db.gz",
listReleases: []listReleases{
{
input: mock.Anything,
output: listReleasesOutput{
releases: []*github.RepositoryRelease{
{
// this release should be skipped due to the wrong prefix of the tag
ID: github.Int64(2),
Name: github.String("v2-2020010101"),
PublishedAt: &github.Timestamp{
Time: time.Date(2020, 1, 1, 1, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(200),
Name: github.String("trivy.db.gz"),
},
},
},
{
ID: github.Int64(1),
Name: github.String("v1-2020123123"),
PublishedAt: &github.Timestamp{
Time: time.Date(2020, 12, 31, 23, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(100),
Name: github.String("trivy.db.gz"),
},
},
},
},
},
},
},
downloadAsset: []downloadAsset{
{
input: 100,
output: downloadAssetOutput{
rc: ioutil.NopCloser(strings.NewReader("foo")),
},
},
},
},
{
name: "happy path with redirect URL",
fileName: "trivy.db.gz",
listReleases: []listReleases{
{
input: mock.Anything,
output: listReleasesOutput{
releases: []*github.RepositoryRelease{
{
ID: github.Int64(1),
Name: github.String("v1-2020123123"),
PublishedAt: &github.Timestamp{
Time: time.Date(2020, 12, 31, 23, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(100),
Name: github.String("trivy.db.gz"),
},
},
},
},
},
},
},
downloadAsset: []downloadAsset{
{
input: 100,
output: downloadAssetOutput{
redirectPath: "/happy",
},
},
},
},
{
name: "happy path with inorder releases",
fileName: "trivy.db.gz",
listReleases: []listReleases{
{
input: mock.Anything,
output: listReleasesOutput{
releases: []*github.RepositoryRelease{
{
ID: github.Int64(1),
Name: github.String("v1-2019100123"),
PublishedAt: &github.Timestamp{
Time: time.Date(2019, 10, 1, 23, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(100),
Name: github.String("trivy.db.gz"),
},
},
},
{
// this release should be used because this is the latest
ID: github.Int64(3),
Name: github.String("v1-2019100200"),
PublishedAt: &github.Timestamp{
Time: time.Date(2019, 10, 2, 0, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(300),
Name: github.String("trivy.db.gz"),
},
},
},
{
ID: github.Int64(2),
Name: github.String("v1-2019100122"),
PublishedAt: &github.Timestamp{
Time: time.Date(2019, 10, 1, 22, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(200),
Name: github.String("trivy.db.gz"),
},
},
},
},
},
},
},
downloadAsset: []downloadAsset{
{
input: 300,
output: downloadAssetOutput{
rc: ioutil.NopCloser(strings.NewReader("foo")),
},
},
},
},
{
name: "happy path with no asset",
fileName: "trivy.db.gz",
listReleases: []listReleases{
{
input: mock.Anything,
output: listReleasesOutput{
releases: []*github.RepositoryRelease{
{
// this release should be skipped due to no asset
ID: github.Int64(1),
Name: github.String("v1-2019100123"),
PublishedAt: &github.Timestamp{
Time: time.Date(2019, 10, 1, 23, 59, 59, 0, time.UTC),
},
},
{
// this release should be skipped due to no asset
ID: github.Int64(3),
Name: github.String("v1-2019100200"),
PublishedAt: &github.Timestamp{
Time: time.Date(2019, 10, 2, 0, 59, 59, 0, time.UTC),
},
},
{
// this release should be used because this release has assets
ID: github.Int64(2),
Name: github.String("v1-2019100122"),
PublishedAt: &github.Timestamp{
Time: time.Date(2019, 10, 1, 22, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(200),
Name: github.String("trivy.db.gz"),
},
},
},
},
},
},
},
downloadAsset: []downloadAsset{
{
input: 200,
output: downloadAssetOutput{
rc: ioutil.NopCloser(strings.NewReader("foo")),
},
},
},
},
{
name: "no asset",
fileName: "trivy.db.gz",
listReleases: []listReleases{
{
input: mock.Anything,
output: listReleasesOutput{
releases: []*github.RepositoryRelease{
{
ID: github.Int64(1),
Name: github.String("v1-2020123000"),
PublishedAt: &github.Timestamp{
Time: time.Date(2020, 12, 31, 23, 59, 59, 0, time.UTC),
},
},
},
},
},
},
expectedError: xerrors.New("DB file not found"),
},
{
name: "the file name doesn't match",
fileName: "trivy-light.db.gz",
listReleases: []listReleases{
{
input: mock.Anything,
output: listReleasesOutput{
releases: []*github.RepositoryRelease{
{
ID: github.Int64(1),
Name: github.String("v1-2020123000"),
PublishedAt: &github.Timestamp{
Time: time.Date(2020, 12, 31, 23, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(100),
Name: github.String("trivy.db.gz"),
},
},
},
},
},
},
},
expectedError: xerrors.New("DB file not found"),
},
{
name: "ListReleases returns error",
fileName: "trivy.db.gz",
listReleases: []listReleases{
{
input: mock.Anything,
output: listReleasesOutput{
err: xerrors.New("something wrong"),
},
},
},
expectedError: xerrors.New("failed to list releases: something wrong"),
},
{
name: "DownloadAsset returns error",
fileName: "trivy.db.gz",
listReleases: []listReleases{
{
input: mock.Anything,
output: listReleasesOutput{
releases: []*github.RepositoryRelease{
{
ID: github.Int64(1),
Name: github.String("v1-2020123000"),
PublishedAt: &github.Timestamp{
Time: time.Date(2020, 12, 31, 23, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(100),
Name: github.String("trivy.db.gz"),
},
},
},
},
},
},
},
downloadAsset: []downloadAsset{
{
input: 100,
output: downloadAssetOutput{
err: xerrors.New("something wrong"),
},
},
},
expectedError: xerrors.New("DB file not found"),
},
{
name: "404 error",
fileName: "trivy.db.gz",
listReleases: []listReleases{
{
input: mock.Anything,
output: listReleasesOutput{
releases: []*github.RepositoryRelease{
{
ID: github.Int64(1),
Name: github.String("v1-2020123000"),
PublishedAt: &github.Timestamp{
Time: time.Date(2020, 12, 31, 23, 59, 59, 0, time.UTC),
},
Assets: []github.ReleaseAsset{
{
ID: github.Int64(100),
Name: github.String("trivy.db.gz"),
},
},
},
},
},
},
},
downloadAsset: []downloadAsset{
{
input: 100,
output: downloadAssetOutput{
redirectPath: "/not_found",
},
},
},
expectedError: xerrors.New("DB file not found"),
},
}
err := log.InitLogger(false, true)
require.NoError(t, err, "Init logger failed")
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case "/happy":
_, _ = fmt.Fprintf(w, "happy")
case "/not_found":
http.NotFound(w, r)
}
return
},
))
defer ts.Close()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
mockRepo := new(MockRepository)
for _, lr := range tc.listReleases {
mockRepo.On("ListReleases", mock.Anything, lr.input).Return(
lr.output.releases, lr.output.response, lr.output.err,
)
}
for _, da := range tc.downloadAsset {
var redirectURL string
if da.output.redirectPath != "" {
u, _ := url.Parse(ts.URL)
u.Path = path.Join(u.Path, da.output.redirectPath)
redirectURL = u.String()
}
mockRepo.On("DownloadAsset", mock.Anything, da.input).Return(
da.output.rc, redirectURL, da.output.err,
)
}
client := Client{
Repository: mockRepo,
}
ctx := context.Background()
rc, err := client.DownloadDB(ctx, tc.fileName)
switch {
case tc.expectedError != nil:
assert.EqualError(t, err, tc.expectedError.Error(), tc.name)
default:
assert.NoError(t, err, tc.name)
assert.NotNil(t, rc, tc.name)
}
mockRepo.AssertExpectations(t)
})
}
}

View File

@@ -6,10 +6,12 @@ import (
"io"
"os"
"strings"
"text/template"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/types"
"github.com/olekukonko/tablewriter"
)
@@ -17,8 +19,31 @@ import (
type Results []Result
type Result struct {
FileName string `json:"Target"`
Vulnerabilities []vulnerability.DetectedVulnerability `json:"Vulnerabilities"`
FileName string `json:"Target"`
Vulnerabilities []types.DetectedVulnerability `json:"Vulnerabilities"`
}
func WriteResults(format string, output io.Writer, results Results, outputTemplate string, light bool) error {
var writer Writer
switch format {
case "table":
writer = &TableWriter{Output: output, Light: light}
case "json":
writer = &JsonWriter{Output: output}
case "template":
tmpl, err := template.New("output template").Parse(outputTemplate)
if err != nil {
return xerrors.Errorf("error parsing template: %w", err)
}
writer = &TemplateWriter{Output: output, Template: tmpl}
default:
return xerrors.Errorf("unknown format: %v", format)
}
if err := writer.Write(results); err != nil {
return xerrors.Errorf("failed to write results: %w", err)
}
return nil
}
type Writer interface {
@@ -27,6 +52,7 @@ type Writer interface {
type TableWriter struct {
Output io.Writer
Light bool
}
func (tw TableWriter) Write(results Results) error {
@@ -37,7 +63,11 @@ func (tw TableWriter) Write(results Results) error {
}
func (tw TableWriter) write(result Result) {
table := tablewriter.NewWriter(tw.Output)
table.SetHeader([]string{"Library", "Vulnerability ID", "Severity", "Installed Version", "Fixed Version", "Title"})
header := []string{"Library", "Vulnerability ID", "Severity", "Installed Version", "Fixed Version"}
if !tw.Light {
header = append(header, "Title")
}
table.SetHeader(header)
severityCount := map[string]int{}
for _, v := range result.Vulnerabilities {
@@ -51,16 +81,22 @@ func (tw TableWriter) write(result Result) {
if len(splittedTitle) >= 12 {
title = strings.Join(splittedTitle[:12], " ") + "..."
}
var row []string
if tw.Output == os.Stdout {
table.Append([]string{v.PkgName, v.VulnerabilityID, vulnerability.ColorizeSeverity(v.Severity),
v.InstalledVersion, v.FixedVersion, title})
row = []string{v.PkgName, v.VulnerabilityID, dbTypes.ColorizeSeverity(v.Severity),
v.InstalledVersion, v.FixedVersion}
} else {
table.Append([]string{v.PkgName, v.VulnerabilityID, v.Severity, v.InstalledVersion, v.FixedVersion, title})
row = []string{v.PkgName, v.VulnerabilityID, v.Severity, v.InstalledVersion, v.FixedVersion}
}
if !tw.Light {
row = append(row, title)
}
table.Append(row)
}
var results []string
for _, severity := range vulnerability.SeverityNames {
for _, severity := range dbTypes.SeverityNames {
r := fmt.Sprintf("%s: %d", severity, severityCount[severity])
results = append(results, r)
}
@@ -94,3 +130,16 @@ func (jw JsonWriter) Write(results Results) error {
}
return nil
}
type TemplateWriter struct {
Output io.Writer
Template *template.Template
}
func (tw TemplateWriter) Write(results Results) error {
err := tw.Template.Execute(tw.Output, results)
if err != nil {
return xerrors.Errorf("failed to write with template: %w", err)
}
return nil
}

248
pkg/report/writer_test.go Normal file
View File

@@ -0,0 +1,248 @@
package report_test
import (
"bytes"
"encoding/json"
"testing"
"github.com/stretchr/testify/assert"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/report"
"github.com/aquasecurity/trivy/pkg/types"
)
func TestReportWriter_Table(t *testing.T) {
testCases := []struct {
name string
detectedVulns []types.DetectedVulnerability
expectedOutput string
light bool
}{
{
name: "happy path full",
detectedVulns: []types.DetectedVulnerability{
{
VulnerabilityID: "123",
PkgName: "foo",
InstalledVersion: "1.2.3",
FixedVersion: "3.4.5",
Vulnerability: dbTypes.Vulnerability{
Title: "foobar",
Description: "baz",
Severity: "HIGH",
},
},
},
expectedOutput: `+---------+------------------+----------+-------------------+---------------+--------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------+------------------+----------+-------------------+---------------+--------+
| foo | 123 | HIGH | 1.2.3 | 3.4.5 | foobar |
+---------+------------------+----------+-------------------+---------------+--------+
`,
},
{
name: "happy path light",
light: true,
detectedVulns: []types.DetectedVulnerability{
{
VulnerabilityID: "123",
PkgName: "foo",
InstalledVersion: "1.2.3",
FixedVersion: "3.4.5",
Vulnerability: dbTypes.Vulnerability{
Title: "foobar",
Description: "baz",
Severity: "HIGH",
},
},
},
expectedOutput: `+---------+------------------+----------+-------------------+---------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION |
+---------+------------------+----------+-------------------+---------------+
| foo | 123 | HIGH | 1.2.3 | 3.4.5 |
+---------+------------------+----------+-------------------+---------------+
`,
},
{
name: "no title for vuln",
detectedVulns: []types.DetectedVulnerability{
{
VulnerabilityID: "123",
PkgName: "foo",
InstalledVersion: "1.2.3",
FixedVersion: "3.4.5",
Vulnerability: dbTypes.Vulnerability{
Description: "foobar",
Severity: "HIGH",
},
},
},
expectedOutput: `+---------+------------------+----------+-------------------+---------------+--------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------+------------------+----------+-------------------+---------------+--------+
| foo | 123 | HIGH | 1.2.3 | 3.4.5 | foobar |
+---------+------------------+----------+-------------------+---------------+--------+
`,
},
{
name: "long title for vuln",
detectedVulns: []types.DetectedVulnerability{
{
VulnerabilityID: "123",
PkgName: "foo",
InstalledVersion: "1.2.3",
FixedVersion: "3.4.5",
Vulnerability: dbTypes.Vulnerability{
Title: "a b c d e f g h i j k l m n o p q r s t u v",
Severity: "HIGH",
},
},
},
expectedOutput: `+---------+------------------+----------+-------------------+---------------+----------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------+------------------+----------+-------------------+---------------+----------------------------+
| foo | 123 | HIGH | 1.2.3 | 3.4.5 | a b c d e f g h i j k l... |
+---------+------------------+----------+-------------------+---------------+----------------------------+
`,
},
{
name: "no vulns",
detectedVulns: []types.DetectedVulnerability{},
expectedOutput: ``,
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
inputResults := report.Results{
{
FileName: "foo",
Vulnerabilities: tc.detectedVulns,
},
}
tableWritten := bytes.Buffer{}
assert.NoError(t, report.WriteResults("table", &tableWritten, inputResults, "", tc.light), tc.name)
assert.Equal(t, tc.expectedOutput, tableWritten.String(), tc.name)
})
}
}
func TestReportWriter_JSON(t *testing.T) {
testCases := []struct {
name string
detectedVulns []types.DetectedVulnerability
expectedJSON report.Results
}{
{
name: "happy path",
detectedVulns: []types.DetectedVulnerability{
{
VulnerabilityID: "123",
PkgName: "foo",
InstalledVersion: "1.2.3",
FixedVersion: "3.4.5",
Vulnerability: dbTypes.Vulnerability{
Title: "foobar",
Description: "baz",
Severity: "HIGH",
},
},
},
expectedJSON: report.Results{
report.Result{
FileName: "foojson",
Vulnerabilities: []types.DetectedVulnerability{
{
VulnerabilityID: "123",
PkgName: "foo",
InstalledVersion: "1.2.3",
FixedVersion: "3.4.5",
Vulnerability: dbTypes.Vulnerability{
Title: "foobar",
Description: "baz",
Severity: "HIGH",
},
},
},
},
},
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
jw := report.JsonWriter{}
jsonWritten := bytes.Buffer{}
jw.Output = &jsonWritten
inputResults := report.Results{
{
FileName: "foojson",
Vulnerabilities: tc.detectedVulns,
},
}
assert.NoError(t, report.WriteResults("json", &jsonWritten, inputResults, "", false), tc.name)
writtenResults := report.Results{}
errJson := json.Unmarshal([]byte(jsonWritten.String()), &writtenResults)
assert.NoError(t, errJson, "invalid json written", tc.name)
assert.Equal(t, tc.expectedJSON, writtenResults, tc.name)
})
}
}
func TestReportWriter_Template(t *testing.T) {
testCases := []struct {
name string
detectedVulns []types.DetectedVulnerability
template string
expected string
}{
{
name: "happy path",
detectedVulns: []types.DetectedVulnerability{
{
VulnerabilityID: "CVE-2019-0000",
PkgName: "foo",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityHigh.String(),
},
},
{
VulnerabilityID: "CVE-2019-0000",
PkgName: "bar",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityHigh.String()},
},
{
VulnerabilityID: "CVE-2019-0001",
PkgName: "baz",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityCritical.String(),
},
},
},
template: "{{ range . }}{{ range .Vulnerabilities}}{{ println .VulnerabilityID .Severity }}{{ end }}{{ end }}",
expected: "CVE-2019-0000 HIGH\nCVE-2019-0000 HIGH\nCVE-2019-0001 CRITICAL\n",
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
tmplWritten := bytes.Buffer{}
inputResults := report.Results{
{
FileName: "foojson",
Vulnerabilities: tc.detectedVulns,
},
}
assert.NoError(t, report.WriteResults("template", &tmplWritten, inputResults, tc.template, false))
assert.Equal(t, tc.expected, tmplWritten.String())
})
}
}

View File

@@ -1,27 +1,27 @@
package pkg
import (
"context"
l "log"
"os"
"strings"
"github.com/aquasecurity/fanal/cache"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy-db/pkg/db"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
dbFile "github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/report"
"github.com/aquasecurity/trivy/pkg/scanner"
"github.com/aquasecurity/trivy/pkg/types"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/vulnerability"
"github.com/genuinetools/reg/registry"
"github.com/urfave/cli"
"golang.org/x/xerrors"
)
func Run(c *cli.Context) (err error) {
cliVersion := c.App.Version
if c.Bool("quiet") || c.Bool("no-progress") {
utils.Quiet = true
}
@@ -30,9 +30,35 @@ func Run(c *cli.Context) (err error) {
l.Fatal(err)
}
if c.String("only-update") != "" || c.Bool("refresh") || c.Bool("auto-refresh") {
log.Logger.Warn("--only-update, --refresh and --auto-refresh are unnecessary and ignored now. These commands will be removed in the next version.")
}
cacheDir := c.String("cache-dir")
utils.SetCacheDir(c.String("cache-dir"))
log.Logger.Debugf("cache dir: %s", utils.CacheDir())
if err = db.Init(cacheDir); err != nil {
return xerrors.Errorf("error in vulnerability DB initialize: %w", err)
}
downloadDBOnly := c.Bool("download-db-only")
skipUpdate := c.Bool("skip-update")
if skipUpdate && downloadDBOnly {
return xerrors.New("The --skip-update and --download-db-only option can not be specified both")
}
light := c.Bool("light")
client := dbFile.NewClient()
ctx := context.Background()
if err = client.Download(ctx, c.App.Version, cacheDir, light, skipUpdate); err != nil {
return xerrors.Errorf("failed to download vulnerability DB: %w", err)
}
if downloadDBOnly {
return nil
}
reset := c.Bool("reset")
if reset {
log.Logger.Info("Resetting...")
@@ -51,74 +77,14 @@ func Run(c *cli.Context) (err error) {
if err = cache.Clear(); err != nil {
return xerrors.New("failed to remove image layer cache")
}
return nil
}
refresh := c.Bool("refresh")
args := c.Args()
var noTarget bool
filePath := c.String("input")
if filePath == "" && len(args) == 0 {
noTarget = true
if !reset && !clearCache && !refresh {
log.Logger.Info(`trivy" requires at least 1 argument or --input option.`)
cli.ShowAppHelpAndExit(c, 1)
}
}
autoRefresh := c.Bool("auto-refresh")
skipUpdate := c.Bool("skip-update")
onlyUpdate := c.String("only-update")
if refresh || autoRefresh {
if skipUpdate {
return xerrors.New("The --skip-update option can not be specified with the --refresh or --auto-refresh option")
}
if onlyUpdate != "" {
return xerrors.New("The --only-update option can not be specified with the --refresh or --auto-refresh option")
}
}
if skipUpdate && onlyUpdate != "" {
return xerrors.New("The --skip-update and --only-update option can not be specified both")
}
if err = db.Init(); err != nil {
return xerrors.Errorf("error in vulnerability DB initialize: %w", err)
}
needRefresh := false
dbVersion := db.GetVersion()
if dbVersion != "" && dbVersion != cliVersion {
if !refresh && !autoRefresh {
return xerrors.New("Detected version update of trivy. Please try again with --refresh or --auto-refresh option")
}
needRefresh = true
}
if refresh || needRefresh {
log.Logger.Info("Refreshing DB...")
if err = db.Reset(); err != nil {
return xerrors.Errorf("error in refresh DB: %w", err)
}
}
updateTargets := vulnsrc.UpdateList
if onlyUpdate != "" {
log.Logger.Warn("The --only-update option may cause the vulnerability details such as severity and title not to be displayed")
updateTargets = strings.Split(onlyUpdate, ",")
}
if !skipUpdate {
if err = vulnsrc.Update(updateTargets); err != nil {
return xerrors.Errorf("error in vulnerability DB update: %w", err)
}
}
if err = db.SetVersion(cliVersion); err != nil {
return xerrors.Errorf("unexpected error: %w", err)
}
// When specifying no image name and file name
if noTarget {
return nil
log.Logger.Info(`trivy requires at least 1 argument or --input option.`)
cli.ShowAppHelpAndExit(c, 1)
}
o := c.String("output")
@@ -129,16 +95,6 @@ func Run(c *cli.Context) (err error) {
}
}
var severities []vulnerability.Severity
for _, s := range strings.Split(c.String("severity"), ",") {
severity, err := vulnerability.NewSeverity(s)
if err != nil {
log.Logger.Infof("error in severity option: %s", err)
cli.ShowAppHelpAndExit(c, 1)
}
severities = append(severities, severity)
}
var imageName string
if filePath == "" {
imageName = args[0]
@@ -155,36 +111,32 @@ func Run(c *cli.Context) (err error) {
}
}
scanOptions := types.ScanOptions{VulnType: strings.Split(c.String("vuln-type"), ",")}
timeout := c.Duration("timeout")
scanOptions := types.ScanOptions{
VulnType: strings.Split(c.String("vuln-type"), ","),
Timeout: timeout,
}
log.Logger.Debugf("Vulnerability type: %s", scanOptions.VulnType)
vulns, err := scanner.ScanImage(imageName, filePath, scanOptions)
results, err := scanner.ScanImage(imageName, filePath, scanOptions)
if err != nil {
return xerrors.Errorf("error in image scan: %w", err)
}
var results report.Results
severities := splitSeverity(c.String("severity"))
ignoreFile := c.String("ignorefile")
ignoreUnfixed := c.Bool("ignore-unfixed")
for path, vuln := range vulns {
results = append(results, report.Result{
FileName: path,
Vulnerabilities: vulnerability.FillAndFilter(vuln, severities, ignoreUnfixed),
})
vulnClient := vulnerability.NewClient()
for i := range results {
results[i].Vulnerabilities = vulnClient.FillAndFilter(results[i].Vulnerabilities,
severities, ignoreUnfixed, ignoreFile, light)
}
var writer report.Writer
switch format := c.String("format"); format {
case "table":
writer = &report.TableWriter{Output: output}
case "json":
writer = &report.JsonWriter{Output: output}
default:
return xerrors.Errorf("unknown format: %v", format)
}
if err = writer.Write(results); err != nil {
return xerrors.Errorf("failed to write results: %w", err)
format := c.String("format")
template := c.String("template")
if err = report.WriteResults(format, output, results, template, light); err != nil {
return xerrors.Errorf("unable to write results: %w", err)
}
exitCode := c.Int("exit-code")
@@ -198,3 +150,15 @@ func Run(c *cli.Context) (err error) {
return nil
}
func splitSeverity(severity string) []dbTypes.Severity {
var severities []dbTypes.Severity
for _, s := range strings.Split(severity, ",") {
severity, err := dbTypes.NewSeverity(s)
if err != nil {
log.Logger.Warnf("unknown severity option: %s", err)
}
severities = append(severities, severity)
}
return severities
}

View File

@@ -1,129 +0,0 @@
package bundler
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/git"
"github.com/aquasecurity/trivy/pkg/utils"
"gopkg.in/yaml.v2"
)
const (
dbURL = "https://github.com/rubysec/ruby-advisory-db.git"
)
var (
repoPath string
)
type AdvisoryDB map[string][]Advisory
type Advisory struct {
Gem string
Cve string
Osvdb string
Ghsa string
Title string
Url string
Description string
CvssV2 float64 `yaml:"cvss_v2"`
CvssV3 float64 `yaml:"cvss_v3"`
PatchedVersions []string `yaml:"patched_versions"`
UnaffectedVersions []string `yaml:"unaffected_versions"`
Related Related
}
type Related struct {
Cve []string
Url []string
}
func (s *Scanner) UpdateDB() (err error) {
repoPath = filepath.Join(utils.CacheDir(), "ruby-advisory-db")
if _, err := git.CloneOrPull(dbURL, repoPath); err != nil {
return xerrors.Errorf("error in %s security DB update: %w", s.Type(), err)
}
s.db, err = s.walk()
return err
}
func (s *Scanner) walk() (AdvisoryDB, error) {
advisoryDB := AdvisoryDB{}
root := filepath.Join(repoPath, "gems")
var vulns []vulnerability.Vulnerability
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
if info.IsDir() {
return nil
}
buf, err := ioutil.ReadFile(path)
if err != nil {
return xerrors.Errorf("failed to read a file: %w", err)
}
advisory := Advisory{}
err = yaml.Unmarshal(buf, &advisory)
if err != nil {
return xerrors.Errorf("failed to unmarshal YAML: %w", err)
}
// for detecting vulnerabilities
advisories, ok := advisoryDB[advisory.Gem]
if !ok {
advisories = []Advisory{}
}
advisoryDB[advisory.Gem] = append(advisories, advisory)
// for displaying vulnerability detail
var vulnerabilityID string
if advisory.Cve != "" {
vulnerabilityID = fmt.Sprintf("CVE-%s", advisory.Cve)
} else if advisory.Osvdb != "" {
vulnerabilityID = fmt.Sprintf("OSVDB-%s", advisory.Osvdb)
} else if advisory.Ghsa != "" {
vulnerabilityID = fmt.Sprintf("GHSA-%s", advisory.Ghsa)
} else {
return nil
}
vulns = append(vulns, vulnerability.Vulnerability{
ID: vulnerabilityID,
CvssScore: advisory.CvssV2,
CvssScoreV3: advisory.CvssV3,
References: append([]string{advisory.Url}, advisory.Related.Url...),
Title: advisory.Title,
Description: advisory.Description,
})
return nil
})
if err != nil {
return nil, xerrors.Errorf("error in file walk: %w", err)
}
if err = s.saveVulnerabilities(vulns); err != nil {
return nil, err
}
return advisoryDB, nil
}
func (s *Scanner) saveVulnerabilities(vulns []vulnerability.Vulnerability) error {
return vulnerability.BatchUpdate(func(b *bbolt.Bucket) error {
for _, vuln := range vulns {
if err := db.Put(b, vuln.ID, vulnerability.RubySec, vuln); err != nil {
return xerrors.Errorf("failed to save %s vulnerability: %w", s.Type(), err)
}
}
return nil
})
}

View File

@@ -1,34 +1,64 @@
package bundler
import (
"fmt"
"os"
"strings"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/knqyf263/go-version"
"golang.org/x/xerrors"
"github.com/aquasecurity/go-dep-parser/pkg/bundler"
ptypes "github.com/aquasecurity/go-dep-parser/pkg/types"
"github.com/knqyf263/go-version"
bundlerSrc "github.com/aquasecurity/trivy-db/pkg/vulnsrc/bundler"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/types"
)
const (
scannerType = "bundler"
)
var (
platformReplacer = strings.NewReplacer(
"-java", "+java",
"-mswin32", "+msin32",
"-mswin64", "+mswin64",
"-universal-mingw32", "+universal-mingw32",
"-x64-mingw32", "+x64-mingw32",
"-x86_64-mingw32", "+x86_64-mingw32",
"-mingw32", "+mingw32",
)
)
type VulnSrc interface {
Get(pkgName string) ([]bundlerSrc.Advisory, error)
}
type Scanner struct {
db AdvisoryDB
vs VulnSrc
}
func massageLockFileVersion(version string) string {
// Move the platform into "metadata" semver section.
// This is because otherwise we end up placing it in the "pre-release" section
// of the semver value, and this breaks our version comparisons in the scanner.
return platformReplacer.Replace(version)
}
func NewScanner() *Scanner {
return &Scanner{}
return &Scanner{
vs: bundlerSrc.NewVulnSrc(),
}
}
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]vulnerability.DetectedVulnerability, error) {
var vulns []vulnerability.DetectedVulnerability
for _, advisory := range s.db[pkgName] {
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]types.DetectedVulnerability, error) {
advisories, err := s.vs.Get(pkgName)
if err != nil {
return nil, xerrors.Errorf("failed to get %s advisories: %w", s.Type(), err)
}
var vulns []types.DetectedVulnerability
for _, advisory := range advisories {
if utils.MatchVersions(pkgVer, advisory.PatchedVersions) {
continue
}
@@ -36,17 +66,9 @@ func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]vulnerabili
continue
}
var vulnerabilityID string
if advisory.Cve != "" {
vulnerabilityID = fmt.Sprintf("CVE-%s", advisory.Cve)
} else if advisory.Osvdb != "" {
vulnerabilityID = fmt.Sprintf("OSVDB-%s", advisory.Osvdb)
}
vuln := vulnerability.DetectedVulnerability{
VulnerabilityID: vulnerabilityID,
PkgName: strings.TrimSpace(advisory.Gem),
Title: strings.TrimSpace(advisory.Title),
vuln := types.DetectedVulnerability{
VulnerabilityID: advisory.VulnerabilityID,
PkgName: strings.TrimSpace(pkgName),
InstalledVersion: pkgVer.String(),
FixedVersion: strings.Join(advisory.PatchedVersions, ", "),
}
@@ -60,6 +82,11 @@ func (s *Scanner) ParseLockfile(f *os.File) ([]ptypes.Library, error) {
if err != nil {
return nil, xerrors.Errorf("invalid Gemfile.lock format: %w", err)
}
for _, lib := range libs {
lib.Version = massageLockFileVersion(lib.Version)
}
return libs, nil
}

View File

@@ -0,0 +1,63 @@
package bundler
import (
"testing"
"github.com/aquasecurity/trivy/pkg/log"
bundlerSrc "github.com/aquasecurity/trivy-db/pkg/vulnsrc/bundler"
"github.com/knqyf263/go-version"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
type MockVulnSrc struct {
mock.Mock
}
func (_m *MockVulnSrc) Get(pkgName string) ([]bundlerSrc.Advisory, error) {
ret := _m.Called(pkgName)
ret0 := ret.Get(0)
if ret0 == nil {
return nil, ret.Error(1)
}
advisories, ok := ret0.([]bundlerSrc.Advisory)
if !ok {
return nil, ret.Error(1)
}
return advisories, ret.Error(1)
}
func TestScanner_Detect(t *testing.T) {
log.InitLogger(false, true)
t.Run("Issue #108", func(t *testing.T) {
// https://github.com/aquasecurity/trivy/issues/108
// Validate that the massaging that happens when parsing the lockfile
// allows us to better handle the platform metadata
mockVulnSrc := new(MockVulnSrc)
mockVulnSrc.On("Get", "ffi").Return(
[]bundlerSrc.Advisory{
{
VulnerabilityID: "NotDetected",
PatchedVersions: []string{">= 1.9.24"},
},
{
VulnerabilityID: "Detected",
PatchedVersions: []string{">= 1.9.26"},
},
}, nil)
s := Scanner{
vs: mockVulnSrc,
}
versionStr := "1.9.25-x64-mingw32"
versionStr = platformReplacer.Replace(versionStr)
v, _ := version.NewVersion(versionStr)
vulns, err := s.Detect("ffi", v)
assert.Nil(t, err)
assert.Equal(t, 1, len(vulns))
})
}

View File

@@ -1,112 +0,0 @@
package cargo
import (
"io/ioutil"
"os"
"path/filepath"
"github.com/BurntSushi/toml"
"github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/git"
"github.com/aquasecurity/trivy/pkg/utils"
)
const (
dbURL = "https://github.com/RustSec/advisory-db.git"
)
var (
repoPath string
)
type AdvisoryDB map[string][]Lockfile
type Lockfile struct {
Advisory `toml:"advisory"`
}
type Advisory struct {
Id string
Package string
Title string `toml:"title"`
Url string
Date string
Description string
Keywords []string
PatchedVersions []string `toml:"patched_versions"`
AffectedFunctions []string `toml:"affected_functions"`
}
func (s *Scanner) UpdateDB() (err error) {
repoPath = filepath.Join(utils.CacheDir(), "rust-advisory-db")
if _, err := git.CloneOrPull(dbURL, repoPath); err != nil {
return xerrors.Errorf("error in %s security DB update: %w", s.Type(), err)
}
s.db, err = s.walk()
return err
}
func (s *Scanner) walk() (AdvisoryDB, error) {
advisoryDB := AdvisoryDB{}
root := filepath.Join(repoPath, "crates")
var vulns []vulnerability.Vulnerability
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
if info.IsDir() {
return nil
}
buf, err := ioutil.ReadFile(path)
if err != nil {
return xerrors.Errorf("failed to read a file: %w", err)
}
advisory := Lockfile{}
err = toml.Unmarshal(buf, &advisory)
if err != nil {
return xerrors.Errorf("failed to unmarshal TOML: %w", err)
}
// for detecting vulnerabilities
advisories, ok := advisoryDB[advisory.Package]
if !ok {
advisories = []Lockfile{}
}
advisoryDB[advisory.Package] = append(advisories, advisory)
// for displaying vulnerability detail
vulns = append(vulns, vulnerability.Vulnerability{
ID: advisory.Id,
References: []string{advisory.Url},
Title: advisory.Title,
Description: advisory.Description,
})
return nil
})
if err != nil {
return nil, xerrors.Errorf("error in file walk: %w", err)
}
if err = s.saveVulnerabilities(vulns); err != nil {
return nil, err
}
return advisoryDB, nil
}
func (s *Scanner) saveVulnerabilities(vulns []vulnerability.Vulnerability) error {
return vulnerability.BatchUpdate(func(b *bbolt.Bucket) error {
for _, vuln := range vulns {
if err := db.Put(b, vuln.ID, vulnerability.RustSec, vuln); err != nil {
return xerrors.Errorf("failed to save %s vulnerability: %w", s.Type(), err)
}
}
return nil
})
}

View File

@@ -4,12 +4,13 @@ import (
"os"
"strings"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/types"
"github.com/aquasecurity/go-dep-parser/pkg/cargo"
ptypes "github.com/aquasecurity/go-dep-parser/pkg/types"
"github.com/knqyf263/go-version"
cargoSrc "github.com/aquasecurity/trivy-db/pkg/vulnsrc/cargo"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/knqyf263/go-version"
"golang.org/x/xerrors"
)
@@ -18,24 +19,30 @@ const (
)
type Scanner struct {
db AdvisoryDB
vs cargoSrc.VulnSrc
}
func NewScanner() *Scanner {
return &Scanner{}
return &Scanner{
vs: cargoSrc.NewVulnSrc(),
}
}
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]vulnerability.DetectedVulnerability, error) {
var vulns []vulnerability.DetectedVulnerability
for _, advisory := range s.db[pkgName] {
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]types.DetectedVulnerability, error) {
advisories, err := s.vs.Get(pkgName)
if err != nil {
return nil, xerrors.Errorf("failed to get %s advisories: %w", s.Type(), err)
}
var vulns []types.DetectedVulnerability
for _, advisory := range advisories {
if utils.MatchVersions(pkgVer, advisory.PatchedVersions) {
continue
}
vuln := vulnerability.DetectedVulnerability{
VulnerabilityID: advisory.Id,
PkgName: strings.TrimSpace(advisory.Package),
Title: strings.TrimSpace(advisory.Title),
vuln := types.DetectedVulnerability{
VulnerabilityID: advisory.VulnerabilityID,
PkgName: strings.TrimSpace(pkgName),
InstalledVersion: pkgVer.String(),
FixedVersion: strings.Join(advisory.PatchedVersions, ", "),
}

View File

@@ -1,109 +0,0 @@
package composer
import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/etcd-io/bbolt"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/git"
"gopkg.in/yaml.v2"
)
const (
dbURL = "https://github.com/FriendsOfPHP/security-advisories"
)
var (
repoPath string
)
type AdvisoryDB map[string][]Advisory
type Advisory struct {
Cve string
Title string
Link string
Reference string
Branches map[string]Branch
}
type Branch struct {
Versions []string
}
func (s *Scanner) UpdateDB() (err error) {
repoPath = filepath.Join(utils.CacheDir(), "php-security-advisories")
if _, err := git.CloneOrPull(dbURL, repoPath); err != nil {
return err
}
s.db, err = s.walk()
return err
}
func (s *Scanner) walk() (AdvisoryDB, error) {
advisoryDB := AdvisoryDB{}
var vulns []vulnerability.Vulnerability
err := filepath.Walk(repoPath, func(path string, info os.FileInfo, err error) error {
if info.IsDir() || !strings.HasPrefix(info.Name(), "CVE-") {
return nil
}
buf, err := ioutil.ReadFile(path)
if err != nil {
return err
}
advisory := Advisory{}
err = yaml.Unmarshal(buf, &advisory)
if err != nil {
return err
}
// for detecting vulnerabilities
advisories, ok := advisoryDB[advisory.Reference]
if !ok {
advisories = []Advisory{}
}
advisoryDB[advisory.Reference] = append(advisories, advisory)
vulnerabilityID := advisory.Cve
if vulnerabilityID == "" {
// e.g. CVE-2019-12139.yaml => CVE-2019-12139
vulnerabilityID = strings.TrimSuffix(info.Name(), ".yaml")
}
// for displaying vulnerability detail
vulns = append(vulns, vulnerability.Vulnerability{
ID: vulnerabilityID,
References: []string{advisory.Link},
Title: advisory.Title,
})
return nil
})
if err != nil {
return nil, xerrors.Errorf("error in file walk: %w", err)
}
if err = s.saveVulnerabilities(vulns); err != nil {
return nil, err
}
return advisoryDB, nil
}
func (s Scanner) saveVulnerabilities(vulns []vulnerability.Vulnerability) error {
return vulnerability.BatchUpdate(func(b *bbolt.Bucket) error {
for _, vuln := range vulns {
if err := db.Put(b, vuln.ID, vulnerability.PhpSecurityAdvisories, vuln); err != nil {
return xerrors.Errorf("failed to save %s vulnerability: %w", s.Type(), err)
}
}
return nil
})
}

View File

@@ -5,14 +5,15 @@ import (
"os"
"strings"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/types"
"golang.org/x/xerrors"
"github.com/aquasecurity/go-dep-parser/pkg/composer"
ptypes "github.com/aquasecurity/go-dep-parser/pkg/types"
"github.com/knqyf263/go-version"
composerSrc "github.com/aquasecurity/trivy-db/pkg/vulnsrc/composer"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/knqyf263/go-version"
)
const (
@@ -20,17 +21,24 @@ const (
)
type Scanner struct {
db AdvisoryDB
vs composerSrc.VulnSrc
}
func NewScanner() *Scanner {
return &Scanner{}
return &Scanner{
vs: composerSrc.NewVulnSrc(),
}
}
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]vulnerability.DetectedVulnerability, error) {
var vulns []vulnerability.DetectedVulnerability
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]types.DetectedVulnerability, error) {
ref := fmt.Sprintf("composer://%s", pkgName)
for _, advisory := range s.db[ref] {
advisories, err := s.vs.Get(ref)
if err != nil {
return nil, xerrors.Errorf("failed to get %s advisories: %w", s.Type(), err)
}
var vulns []types.DetectedVulnerability
for _, advisory := range advisories {
var affectedVersions []string
var patchedVersions []string
for _, branch := range advisory.Branches {
@@ -46,10 +54,9 @@ func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]vulnerabili
continue
}
vuln := vulnerability.DetectedVulnerability{
VulnerabilityID: advisory.Cve,
vuln := types.DetectedVulnerability{
VulnerabilityID: advisory.VulnerabilityID,
PkgName: pkgName,
Title: strings.TrimSpace(advisory.Title),
InstalledVersion: pkgVer.String(),
FixedVersion: strings.Join(patchedVersions, ", "),
}

View File

@@ -1,123 +0,0 @@
package node
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/git"
)
const (
dbURL = "https://github.com/nodejs/security-wg.git"
)
var (
repoPath string
)
type AdvisoryDB map[string][]Advisory
type Advisory struct {
ID int
Title string
ModuleName string `json:"module_name""`
Cves []string
VulnerableVersions string `json:"vulnerable_versions"`
PatchedVersions string `json:"patched_versions"`
Overview string
Recommendation string
References []string
CvssScoreNumber json.Number `json:"cvss_score"`
CvssScore float64
}
func (s *Scanner) UpdateDB() (err error) {
repoPath = filepath.Join(utils.CacheDir(), "nodejs-security-wg")
if _, err := git.CloneOrPull(dbURL, repoPath); err != nil {
return err
}
s.db, err = s.walk()
return err
}
func (s *Scanner) walk() (AdvisoryDB, error) {
advisoryDB := AdvisoryDB{}
var vulns []vulnerability.Vulnerability
err := filepath.Walk(filepath.Join(repoPath, "vuln"), func(path string, info os.FileInfo, err error) error {
if info.IsDir() || !strings.HasSuffix(info.Name(), ".json") {
return nil
}
f, err := os.Open(path)
if err != nil {
return err
}
defer f.Close()
advisory := Advisory{}
if err = json.NewDecoder(f).Decode(&advisory); err != nil {
return err
}
advisory.ModuleName = strings.ToLower(advisory.ModuleName)
// `cvss_score` returns float or string like "4.8 (MEDIUM)"
s := strings.Split(advisory.CvssScoreNumber.String(), " ")
advisory.CvssScore, err = strconv.ParseFloat(s[0], 64)
if err != nil {
advisory.CvssScore = -1
}
// for detecting vulnerabilities
advisories, ok := advisoryDB[advisory.ModuleName]
if !ok {
advisories = []Advisory{}
}
advisoryDB[advisory.ModuleName] = append(advisories, advisory)
// for displaying vulnerability detail
vulnerabilityIDs := advisory.Cves
if len(vulnerabilityIDs) == 0 {
vulnerabilityIDs = []string{fmt.Sprintf("NSWG-ECO-%d", advisory.ID)}
}
for _, vulnID := range vulnerabilityIDs {
vulns = append(vulns, vulnerability.Vulnerability{
ID: vulnID,
CvssScore: advisory.CvssScore,
References: advisory.References,
Title: advisory.Title,
Description: advisory.Overview,
})
}
return nil
})
if err != nil {
return nil, xerrors.Errorf("error in file walk: %w", err)
}
if err = s.saveVulnerabilities(vulns); err != nil {
return nil, err
}
return advisoryDB, nil
}
func (s Scanner) saveVulnerabilities(vulns []vulnerability.Vulnerability) error {
return vulnerability.BatchUpdate(func(b *bbolt.Bucket) error {
for _, vuln := range vulns {
if err := db.Put(b, vuln.ID, vulnerability.NodejsSecurityWg, vuln); err != nil {
return xerrors.Errorf("failed to save %s vulnerability: %w", s.Type(), err)
}
}
return nil
})
}

View File

@@ -1,19 +1,18 @@
package node
import (
"fmt"
"os"
"strings"
version "github.com/knqyf263/go-version"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/xerrors"
"github.com/aquasecurity/go-dep-parser/pkg/npm"
ptypes "github.com/aquasecurity/go-dep-parser/pkg/types"
"github.com/aquasecurity/go-dep-parser/pkg/yarn"
"github.com/aquasecurity/trivy-db/pkg/vulnsrc/node"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/aquasecurity/trivy/pkg/types"
)
const (
@@ -22,18 +21,26 @@ const (
)
type Scanner struct {
db AdvisoryDB
scannerType string
vs node.VulnSrc
}
func NewScanner(scannerType string) *Scanner {
return &Scanner{scannerType: scannerType}
return &Scanner{
scannerType: scannerType,
vs: node.NewVulnSrc(),
}
}
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]vulnerability.DetectedVulnerability, error) {
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]types.DetectedVulnerability, error) {
replacer := strings.NewReplacer(".alpha", "-alpha", ".beta", "-beta", ".rc", "-rc", " <", ", <", " >", ", >")
var vulns []vulnerability.DetectedVulnerability
for _, advisory := range s.db[pkgName] {
advisories, err := s.vs.Get(pkgName)
if err != nil {
return nil, xerrors.Errorf("failed to get %s advisories: %w", s.Type(), err)
}
var vulns []types.DetectedVulnerability
for _, advisory := range advisories {
// e.g. <= 2.15.0 || >= 3.0.0 <= 3.8.2
// => {"<=2.15.0", ">= 3.0.0, <= 3.8.2"}
var vulnerableVersions []string
@@ -56,20 +63,13 @@ func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]vulnerabili
continue
}
if len(advisory.Cves) == 0 {
advisory.Cves = []string{fmt.Sprintf("NSWG-ECO-%d", advisory.ID)}
}
for _, cveID := range advisory.Cves {
vuln := vulnerability.DetectedVulnerability{
VulnerabilityID: cveID,
PkgName: pkgName,
Title: strings.TrimSpace(advisory.Title),
InstalledVersion: pkgVer.String(),
FixedVersion: strings.Join(patchedVersions, ", "),
}
vulns = append(vulns, vuln)
vuln := types.DetectedVulnerability{
VulnerabilityID: advisory.VulnerabilityID,
PkgName: pkgName,
InstalledVersion: pkgVer.String(),
FixedVersion: strings.Join(patchedVersions, ", "),
}
vulns = append(vulns, vuln)
}
return vulns, nil
}

View File

@@ -1,93 +0,0 @@
package python
import (
"encoding/json"
"os"
"path/filepath"
"github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/git"
)
const (
dbURL = "https://github.com/pyupio/safety-db.git"
)
var (
repoPath string
)
type AdvisoryDB map[string][]Advisory
type Advisory struct {
ID string
Advisory string
Cve string
Specs []string
Version string `json:"v"`
}
func (s *Scanner) UpdateDB() (err error) {
repoPath = filepath.Join(utils.CacheDir(), "python-safety-db")
if _, err := git.CloneOrPull(dbURL, repoPath); err != nil {
return err
}
s.db, err = s.parse()
if err != nil {
return xerrors.Errorf("failed to parse python safety-db: %w", err)
}
return nil
}
func (s *Scanner) parse() (AdvisoryDB, error) {
advisoryDB := AdvisoryDB{}
f, err := os.Open(filepath.Join(repoPath, "data", "insecure_full.json"))
if err != nil {
return nil, err
}
defer f.Close()
// for detecting vulnerabilities
if err = json.NewDecoder(f).Decode(&advisoryDB); err != nil {
return nil, err
}
// for displaying vulnerability detail
var vulns []vulnerability.Vulnerability
for _, advisories := range advisoryDB {
for _, advisory := range advisories {
vulnerabilityID := advisory.Cve
if vulnerabilityID == "" {
vulnerabilityID = advisory.ID
}
vulns = append(vulns, vulnerability.Vulnerability{
ID: vulnerabilityID,
Title: advisory.Advisory,
})
}
}
if err = s.saveVulnerabilities(vulns); err != nil {
return nil, err
}
return advisoryDB, nil
}
func (s Scanner) saveVulnerabilities(vulns []vulnerability.Vulnerability) error {
return vulnerability.BatchUpdate(func(b *bbolt.Bucket) error {
for _, vuln := range vulns {
if err := db.Put(b, vuln.ID, vulnerability.PythonSafetyDB, vuln); err != nil {
return xerrors.Errorf("failed to save %s vulnerability: %w", s.Type(), err)
}
}
return nil
})
}

View File

@@ -4,15 +4,16 @@ import (
"os"
"strings"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy-db/pkg/vulnsrc/python"
"github.com/aquasecurity/trivy/pkg/types"
"golang.org/x/xerrors"
"github.com/aquasecurity/go-dep-parser/pkg/pipenv"
"github.com/aquasecurity/go-dep-parser/pkg/poetry"
ptypes "github.com/aquasecurity/go-dep-parser/pkg/types"
"github.com/knqyf263/go-version"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/knqyf263/go-version"
)
const (
@@ -21,30 +22,32 @@ const (
)
type Scanner struct {
db AdvisoryDB
scannerType string
vs python.VulnSrc
}
func NewScanner(scannerType string) *Scanner {
return &Scanner{scannerType: scannerType}
return &Scanner{
scannerType: scannerType,
vs: python.NewVulnSrc(),
}
}
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]vulnerability.DetectedVulnerability, error) {
var vulns []vulnerability.DetectedVulnerability
for _, advisory := range s.db[pkgName] {
func (s *Scanner) Detect(pkgName string, pkgVer *version.Version) ([]types.DetectedVulnerability, error) {
advisories, err := s.vs.Get(pkgName)
if err != nil {
return nil, xerrors.Errorf("failed to get %s advisories: %w", s.Type(), err)
}
var vulns []types.DetectedVulnerability
for _, advisory := range advisories {
if !utils.MatchVersions(pkgVer, advisory.Specs) {
continue
}
vulnerabilityID := advisory.Cve
if vulnerabilityID == "" {
vulnerabilityID = advisory.ID
}
vuln := vulnerability.DetectedVulnerability{
VulnerabilityID: vulnerabilityID,
vuln := types.DetectedVulnerability{
VulnerabilityID: advisory.VulnerabilityID,
PkgName: pkgName,
Title: strings.TrimSpace(advisory.Advisory),
InstalledVersion: pkgVer.String(),
FixedVersion: createFixedVersions(advisory.Specs),
}

View File

@@ -4,8 +4,6 @@ import (
"os"
"path/filepath"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/fanal/analyzer"
_ "github.com/aquasecurity/fanal/analyzer/library/bundler"
_ "github.com/aquasecurity/fanal/analyzer/library/cargo"
@@ -16,7 +14,6 @@ import (
_ "github.com/aquasecurity/fanal/analyzer/library/yarn"
"github.com/aquasecurity/fanal/extractor"
ptypes "github.com/aquasecurity/go-dep-parser/pkg/types"
"github.com/knqyf263/go-version"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/scanner/library/bundler"
"github.com/aquasecurity/trivy/pkg/scanner/library/cargo"
@@ -24,13 +21,13 @@ import (
"github.com/aquasecurity/trivy/pkg/scanner/library/node"
"github.com/aquasecurity/trivy/pkg/scanner/library/python"
"github.com/aquasecurity/trivy/pkg/types"
"github.com/knqyf263/go-version"
"golang.org/x/xerrors"
)
type Scanner interface {
UpdateDB() error
ParseLockfile(*os.File) ([]ptypes.Library, error)
Detect(string, *version.Version) ([]vulnerability.DetectedVulnerability, error)
Detect(string, *version.Version) ([]types.DetectedVulnerability, error)
Type() string
}
@@ -57,13 +54,13 @@ func NewScanner(filename string) Scanner {
return scanner
}
func Scan(files extractor.FileMap, scanOptions types.ScanOptions) (map[string][]vulnerability.DetectedVulnerability, error) {
func Scan(files extractor.FileMap, scanOptions types.ScanOptions) (map[string][]types.DetectedVulnerability, error) {
results, err := analyzer.GetLibraries(files)
if err != nil {
return nil, xerrors.Errorf("failed to analyze libraries: %w", err)
}
vulnerabilities := map[string][]vulnerability.DetectedVulnerability{}
vulnerabilities := map[string][]types.DetectedVulnerability{}
for path, pkgs := range results {
log.Logger.Debugf("Detecting library vulnerabilities, path: %s", path)
scanner := NewScanner(filepath.Base(string(path)))
@@ -81,7 +78,7 @@ func Scan(files extractor.FileMap, scanOptions types.ScanOptions) (map[string][]
return vulnerabilities, nil
}
func ScanFile(f *os.File) ([]vulnerability.DetectedVulnerability, error) {
func ScanFile(f *os.File) ([]types.DetectedVulnerability, error) {
scanner := NewScanner(filepath.Base(f.Name()))
if scanner == nil {
return nil, xerrors.New("unknown file type")
@@ -99,15 +96,9 @@ func ScanFile(f *os.File) ([]vulnerability.DetectedVulnerability, error) {
return vulns, nil
}
func scan(scanner Scanner, pkgs []ptypes.Library) ([]vulnerability.DetectedVulnerability, error) {
log.Logger.Infof("Updating %s Security DB...", scanner.Type())
err := scanner.UpdateDB()
if err != nil {
return nil, xerrors.Errorf("failed to update %s advisories: %w", scanner.Type(), err)
}
func scan(scanner Scanner, pkgs []ptypes.Library) ([]types.DetectedVulnerability, error) {
log.Logger.Infof("Detecting %s vulnerabilities...", scanner.Type())
var vulnerabilities []vulnerability.DetectedVulnerability
var vulnerabilities []types.DetectedVulnerability
for _, pkg := range pkgs {
v, err := version.NewVersion(pkg.Version)
if err != nil {

View File

@@ -4,13 +4,15 @@ import (
"strings"
"time"
"github.com/aquasecurity/fanal/analyzer"
version "github.com/knqyf263/go-rpm-version"
"golang.org/x/xerrors"
"github.com/aquasecurity/fanal/analyzer"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy-db/pkg/vulnsrc/alpine"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/alpine"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/types"
)
var (
@@ -37,13 +39,17 @@ var (
}
)
type Scanner struct{}
func NewScanner() *Scanner {
return &Scanner{}
type Scanner struct {
vs dbTypes.VulnSrc
}
func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability.DetectedVulnerability, error) {
func NewScanner() *Scanner {
return &Scanner{
vs: alpine.NewVulnSrc(),
}
}
func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]types.DetectedVulnerability, error) {
log.Logger.Info("Detecting Alpine vulnerabilities...")
if strings.Count(osVer, ".") > 1 {
osVer = osVer[:strings.LastIndex(osVer, ".")]
@@ -51,9 +57,9 @@ func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability
log.Logger.Debugf("alpine: os version: %s", osVer)
log.Logger.Debugf("alpine: the number of packages: %d", len(pkgs))
var vulns []vulnerability.DetectedVulnerability
var vulns []types.DetectedVulnerability
for _, pkg := range pkgs {
advisories, err := alpine.Get(osVer, pkg.Name)
advisories, err := s.vs.Get(osVer, pkg.Name)
if err != nil {
return nil, xerrors.Errorf("failed to get alpine advisories: %w", err)
}
@@ -64,7 +70,7 @@ func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability
for _, adv := range advisories {
fixedVersion := version.NewVersion(adv.FixedVersion)
if installedVersion.LessThan(fixedVersion) {
vuln := vulnerability.DetectedVulnerability{
vuln := types.DetectedVulnerability{
VulnerabilityID: adv.VulnerabilityID,
PkgName: pkg.Name,
InstalledVersion: installed,

View File

@@ -0,0 +1,82 @@
package amazon
import (
"strings"
"go.uber.org/zap"
version "github.com/knqyf263/go-deb-version"
"golang.org/x/xerrors"
"github.com/aquasecurity/fanal/analyzer"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy-db/pkg/vulnsrc/amazon"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/aquasecurity/trivy/pkg/types"
)
type Scanner struct {
l *zap.SugaredLogger
ac dbTypes.VulnSrc
}
func NewScanner() *Scanner {
return &Scanner{
l: log.Logger,
ac: amazon.NewVulnSrc(),
}
}
func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]types.DetectedVulnerability, error) {
log.Logger.Info("Detecting Amazon Linux vulnerabilities...")
osVer = strings.Fields(osVer)[0]
if osVer != "2" {
osVer = "1"
}
log.Logger.Debugf("amazon: os version: %s", osVer)
log.Logger.Debugf("amazon: the number of packages: %d", len(pkgs))
var vulns []types.DetectedVulnerability
for _, pkg := range pkgs {
advisories, err := s.ac.Get(osVer, pkg.Name)
if err != nil {
return nil, xerrors.Errorf("failed to get amazon advisories: %w", err)
}
installed := utils.FormatVersion(pkg)
if installed == "" {
continue
}
installedVersion, err := version.NewVersion(installed)
if err != nil {
log.Logger.Debugf("failed to parse Amazon Linux installed package version: %s", err)
continue
}
for _, adv := range advisories {
fixedVersion, err := version.NewVersion(adv.FixedVersion)
if err != nil {
log.Logger.Debugf("failed to parse Amazon Linux package version: %s", err)
continue
}
if installedVersion.LessThan(fixedVersion) {
vuln := types.DetectedVulnerability{
VulnerabilityID: adv.VulnerabilityID,
PkgName: pkg.Name,
InstalledVersion: installed,
FixedVersion: adv.FixedVersion,
}
vulns = append(vulns, vuln)
}
}
}
return vulns, nil
}
func (s *Scanner) IsSupportedVersion(osFamily, osVer string) bool {
return true
}

View File

@@ -0,0 +1,168 @@
package amazon
import (
"errors"
"testing"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"go.uber.org/zap/zaptest/observer"
"github.com/aquasecurity/fanal/analyzer"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/types"
)
type MockAmazonConfig struct {
update func(string) error
get func(string, string) ([]dbTypes.Advisory, error)
}
func (mac MockAmazonConfig) Update(a string) error {
if mac.update != nil {
return mac.update(a)
}
return nil
}
func (mac MockAmazonConfig) Get(a string, b string) ([]dbTypes.Advisory, error) {
if mac.get != nil {
return mac.get(a, b)
}
return []dbTypes.Advisory{}, nil
}
func TestScanner_Detect(t *testing.T) {
t.Run("happy path", func(t *testing.T) {
zc, recorder := observer.New(zapcore.DebugLevel)
log.Logger = zap.New(zc).Sugar()
s := &Scanner{
l: log.Logger,
ac: MockAmazonConfig{
get: func(s string, s2 string) (advisories []dbTypes.Advisory, e error) {
return []dbTypes.Advisory{
{
VulnerabilityID: "123",
FixedVersion: "3.0.0",
},
}, nil
},
},
}
vuls, err := s.Detect("3.1.0", []analyzer.Package{
{
Name: "testpkg",
Version: "2.1.0",
Release: "hotfix",
SrcRelease: "test-hotfix",
SrcVersion: "2.1.0",
},
{
Name: "foopkg",
},
})
assert.NoError(t, err)
assert.Equal(t, []types.DetectedVulnerability{
{
VulnerabilityID: "123",
PkgName: "testpkg",
InstalledVersion: "2.1.0-hotfix",
FixedVersion: "3.0.0",
},
}, vuls)
loggedMessages := getAllLoggedLogs(recorder)
assert.Contains(t, loggedMessages, "amazon: os version: 1")
assert.Contains(t, loggedMessages, "amazon: the number of packages: 2")
})
t.Run("get vulnerabilities fails to fetch", func(t *testing.T) {
_ = log.InitLogger(true, false)
s := &Scanner{
l: log.Logger,
ac: MockAmazonConfig{
get: func(s string, s2 string) (advisories []dbTypes.Advisory, e error) {
return nil, errors.New("failed to fetch advisories")
},
},
}
vuls, err := s.Detect("foo", []analyzer.Package{
{
Name: "testpkg",
},
})
assert.Equal(t, "failed to get amazon advisories: failed to fetch advisories", err.Error())
assert.Empty(t, vuls)
})
t.Run("invalid installed package version", func(t *testing.T) {
zc, recorder := observer.New(zapcore.DebugLevel)
log.Logger = zap.New(zc).Sugar()
s := &Scanner{
l: log.Logger,
ac: MockAmazonConfig{
get: func(s string, s2 string) (advisories []dbTypes.Advisory, e error) {
return []dbTypes.Advisory{
{
VulnerabilityID: "123",
FixedVersion: "3.0.0",
},
}, nil
},
},
}
vuls, err := s.Detect("3.1.0", []analyzer.Package{
{
Name: "testpkg",
Version: "badsourceversion",
},
})
assert.NoError(t, err)
assert.Equal(t, []types.DetectedVulnerability(nil), vuls)
loggedMessages := getAllLoggedLogs(recorder)
assert.Contains(t, loggedMessages, "failed to parse Amazon Linux installed package version: upstream_version must start with digit")
})
t.Run("invalid fixed package version", func(t *testing.T) {
zc, recorder := observer.New(zapcore.DebugLevel)
log.Logger = zap.New(zc).Sugar()
s := &Scanner{
l: log.Logger,
ac: MockAmazonConfig{
get: func(s string, s2 string) (advisories []dbTypes.Advisory, e error) {
return []dbTypes.Advisory{
{
VulnerabilityID: "123",
FixedVersion: "thisisbadversioning",
},
}, nil
},
},
}
vuls, err := s.Detect("3.1.0", []analyzer.Package{
{
Name: "testpkg",
Version: "3.1.0",
},
})
assert.NoError(t, err)
assert.Equal(t, []types.DetectedVulnerability(nil), vuls)
loggedMessages := getAllLoggedLogs(recorder)
assert.Contains(t, loggedMessages, "failed to parse Amazon Linux package version: upstream_version must start with digit")
})
}
func getAllLoggedLogs(recorder *observer.ObservedLogs) []string {
allLogs := recorder.AllUntimed()
var loggedMessages []string
for _, l := range allLogs {
loggedMessages = append(loggedMessages, l.Message)
}
return loggedMessages
}

View File

@@ -4,15 +4,17 @@ import (
"strings"
"time"
"github.com/aquasecurity/fanal/analyzer"
"github.com/aquasecurity/trivy-db/pkg/vulnsrc/debian"
debianoval "github.com/aquasecurity/trivy-db/pkg/vulnsrc/debian-oval"
version "github.com/knqyf263/go-deb-version"
"golang.org/x/xerrors"
"github.com/aquasecurity/fanal/analyzer"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/debian"
debianoval "github.com/aquasecurity/trivy/pkg/vulnsrc/debian-oval"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/types"
)
var (
@@ -38,13 +40,19 @@ var (
}
)
type Scanner struct{}
func NewScanner() *Scanner {
return &Scanner{}
type Scanner struct {
ovalVs dbTypes.VulnSrc
vs dbTypes.VulnSrc
}
func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability.DetectedVulnerability, error) {
func NewScanner() *Scanner {
return &Scanner{
ovalVs: debianoval.NewVulnSrc(),
vs: debian.NewVulnSrc(),
}
}
func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]types.DetectedVulnerability, error) {
log.Logger.Info("Detecting Debian vulnerabilities...")
if strings.Count(osVer, ".") > 0 {
@@ -53,9 +61,9 @@ func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability
log.Logger.Debugf("debian: os version: %s", osVer)
log.Logger.Debugf("debian: the number of packages: %d", len(pkgs))
var vulns []vulnerability.DetectedVulnerability
var vulns []types.DetectedVulnerability
for _, pkg := range pkgs {
advisories, err := debianoval.Get(osVer, pkg.SrcName)
advisories, err := s.ovalVs.Get(osVer, pkg.SrcName)
if err != nil {
return nil, xerrors.Errorf("failed to get debian OVAL: %w", err)
}
@@ -75,7 +83,7 @@ func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability
}
if installedVersion.LessThan(fixedVersion) {
vuln := vulnerability.DetectedVulnerability{
vuln := types.DetectedVulnerability{
VulnerabilityID: adv.VulnerabilityID,
PkgName: pkg.Name,
InstalledVersion: installed,
@@ -84,12 +92,12 @@ func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability
vulns = append(vulns, vuln)
}
}
advisories, err = debian.Get(osVer, pkg.SrcName)
advisories, err = s.vs.Get(osVer, pkg.SrcName)
if err != nil {
return nil, xerrors.Errorf("failed to get debian advisory: %w", err)
}
for _, adv := range advisories {
vuln := vulnerability.DetectedVulnerability{
vuln := types.DetectedVulnerability{
VulnerabilityID: adv.VulnerabilityID,
PkgName: pkg.Name,
InstalledVersion: installed,

View File

@@ -4,14 +4,17 @@ import (
"strings"
"time"
"github.com/aquasecurity/trivy-db/pkg/vulnsrc/redhat"
version "github.com/knqyf263/go-rpm-version"
"golang.org/x/xerrors"
"github.com/aquasecurity/fanal/analyzer"
"github.com/aquasecurity/fanal/analyzer/os"
version "github.com/knqyf263/go-rpm-version"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/redhat"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/types"
)
var (
@@ -34,13 +37,17 @@ var (
}
)
type Scanner struct{}
func NewScanner() *Scanner {
return &Scanner{}
type Scanner struct {
vs dbTypes.VulnSrc
}
func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability.DetectedVulnerability, error) {
func NewScanner() *Scanner {
return &Scanner{
vs: redhat.NewVulnSrc(),
}
}
func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]types.DetectedVulnerability, error) {
log.Logger.Info("Detecting RHEL/CentOS vulnerabilities...")
if strings.Count(osVer, ".") > 0 {
osVer = osVer[:strings.Index(osVer, ".")]
@@ -48,9 +55,9 @@ func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability
log.Logger.Debugf("redhat: os version: %s", osVer)
log.Logger.Debugf("redhat: the number of packages: %d", len(pkgs))
var vulns []vulnerability.DetectedVulnerability
var vulns []types.DetectedVulnerability
for _, pkg := range pkgs {
advisories, err := redhat.Get(osVer, pkg.SrcName)
advisories, err := s.vs.Get(osVer, pkg.SrcName)
if err != nil {
return nil, xerrors.Errorf("failed to get Red Hat advisories: %w", err)
}
@@ -60,13 +67,13 @@ func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability
for _, adv := range advisories {
fixedVersion := version.NewVersion(adv.FixedVersion)
vuln := vulnerability.DetectedVulnerability{
vuln := types.DetectedVulnerability{
VulnerabilityID: adv.VulnerabilityID,
PkgName: pkg.Name,
InstalledVersion: installed,
}
if installedVersion.LessThan(fixedVersion) {
vuln.FixedVersion = adv.FixedVersion
vuln.FixedVersion = fixedVersion.String()
vulns = append(vulns, vuln)
} else if adv.FixedVersion == "" {
vulns = append(vulns, vuln)

View File

@@ -12,21 +12,23 @@ import (
_ "github.com/aquasecurity/fanal/analyzer/pkg/apk"
_ "github.com/aquasecurity/fanal/analyzer/pkg/dpkg"
"github.com/aquasecurity/fanal/extractor"
ftypes "github.com/aquasecurity/fanal/types"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/scanner/ospkg/alpine"
"github.com/aquasecurity/trivy/pkg/scanner/ospkg/amazon"
"github.com/aquasecurity/trivy/pkg/scanner/ospkg/debian"
"github.com/aquasecurity/trivy/pkg/scanner/ospkg/redhat"
"github.com/aquasecurity/trivy/pkg/scanner/ospkg/ubuntu"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/types"
"golang.org/x/xerrors"
)
type Scanner interface {
Detect(string, []analyzer.Package) ([]vulnerability.DetectedVulnerability, error)
Detect(string, []analyzer.Package) ([]types.DetectedVulnerability, error)
IsSupportedVersion(string, string) bool
}
func Scan(files extractor.FileMap) (string, string, []vulnerability.DetectedVulnerability, error) {
func Scan(files extractor.FileMap) (string, string, []types.DetectedVulnerability, error) {
os, err := analyzer.GetOS(files)
if err != nil {
return "", "", nil, xerrors.Errorf("failed to analyze OS: %w", err)
@@ -43,12 +45,17 @@ func Scan(files extractor.FileMap) (string, string, []vulnerability.DetectedVuln
s = ubuntu.NewScanner()
case fos.RedHat, fos.CentOS:
s = redhat.NewScanner()
case fos.Amazon:
s = amazon.NewScanner()
default:
log.Logger.Warnf("unsupported os : %s", os.Family)
return "", "", nil, nil
}
pkgs, err := analyzer.GetPackages(files)
if err != nil {
if xerrors.Is(err, ftypes.ErrNoRpmCmd) {
log.Logger.Error("'rpm' command is not installed")
}
return "", "", nil, xerrors.Errorf("failed to analyze OS packages: %w", err)
}
log.Logger.Debugf("the number of packages: %d", len(pkgs))

View File

@@ -3,14 +3,16 @@ package ubuntu
import (
"time"
"github.com/aquasecurity/trivy-db/pkg/vulnsrc/ubuntu"
version "github.com/knqyf263/go-deb-version"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/xerrors"
"github.com/aquasecurity/fanal/analyzer"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/vulnsrc/ubuntu"
"github.com/aquasecurity/trivy/pkg/scanner/utils"
"github.com/aquasecurity/trivy/pkg/types"
)
var (
@@ -49,20 +51,24 @@ var (
}
)
type Scanner struct{}
func NewScanner() *Scanner {
return &Scanner{}
type Scanner struct {
vs dbTypes.VulnSrc
}
func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability.DetectedVulnerability, error) {
func NewScanner() *Scanner {
return &Scanner{
vs: ubuntu.NewVulnSrc(),
}
}
func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]types.DetectedVulnerability, error) {
log.Logger.Info("Detecting Ubuntu vulnerabilities...")
log.Logger.Debugf("ubuntu: os version: %s", osVer)
log.Logger.Debugf("ubuntu: the number of packages: %d", len(pkgs))
var vulns []vulnerability.DetectedVulnerability
var vulns []types.DetectedVulnerability
for _, pkg := range pkgs {
advisories, err := ubuntu.Get(osVer, pkg.SrcName)
advisories, err := s.vs.Get(osVer, pkg.SrcName)
if err != nil {
return nil, xerrors.Errorf("failed to get Ubuntu advisories: %w", err)
}
@@ -75,7 +81,7 @@ func (s *Scanner) Detect(osVer string, pkgs []analyzer.Package) ([]vulnerability
}
for _, adv := range advisories {
vuln := vulnerability.DetectedVulnerability{
vuln := types.DetectedVulnerability{
VulnerabilityID: adv.VulnerabilityID,
PkgName: pkg.Name,
InstalledVersion: installed,

View File

@@ -5,6 +5,9 @@ import (
"flag"
"fmt"
"os"
"sort"
"github.com/aquasecurity/trivy/pkg/report"
"github.com/aquasecurity/fanal/analyzer"
"github.com/aquasecurity/fanal/extractor"
@@ -12,13 +15,12 @@ import (
"github.com/aquasecurity/trivy/pkg/scanner/ospkg"
"github.com/aquasecurity/trivy/pkg/types"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/xerrors"
)
func ScanImage(imageName, filePath string, scanOptions types.ScanOptions) (map[string][]vulnerability.DetectedVulnerability, error) {
results := map[string][]vulnerability.DetectedVulnerability{}
func ScanImage(imageName, filePath string, scanOptions types.ScanOptions) (report.Results, error) {
results := report.Results{}
ctx := context.Background()
var target string
@@ -29,6 +31,8 @@ func ScanImage(imageName, filePath string, scanOptions types.ScanOptions) (map[s
if err != nil {
return nil, xerrors.Errorf("failed to get docker option: %w", err)
}
dockerOption.Timeout = scanOptions.Timeout
files, err = analyzer.Analyze(ctx, imageName, dockerOption)
if err != nil {
return nil, xerrors.Errorf("failed to analyze image: %w", err)
@@ -40,7 +44,7 @@ func ScanImage(imageName, filePath string, scanOptions types.ScanOptions) (map[s
return nil, xerrors.Errorf("failed to open stream: %w", err)
}
files, err = analyzer.AnalyzeFromFile(ctx, rc)
files, err = analyzer.AnalyzeFile(ctx, rc)
if err != nil {
return nil, err
}
@@ -55,7 +59,10 @@ func ScanImage(imageName, filePath string, scanOptions types.ScanOptions) (map[s
}
if osFamily != "" {
imageDetail := fmt.Sprintf("%s (%s %s)", target, osFamily, osVersion)
results[imageDetail] = osVulns
results = append(results, report.Result{
FileName: imageDetail,
Vulnerabilities: osVulns,
})
}
}
@@ -64,21 +71,30 @@ func ScanImage(imageName, filePath string, scanOptions types.ScanOptions) (map[s
if err != nil {
return nil, xerrors.Errorf("failed to scan libraries: %w", err)
}
var libResults report.Results
for path, vulns := range libVulns {
results[path] = vulns
libResults = append(libResults, report.Result{
FileName: path,
Vulnerabilities: vulns,
})
}
sort.Slice(libResults, func(i, j int) bool {
return libResults[i].FileName < libResults[j].FileName
})
results = append(results, libResults...)
}
return results, nil
}
func ScanFile(f *os.File) (map[string][]vulnerability.DetectedVulnerability, error) {
func ScanFile(f *os.File) (report.Results, error) {
vulns, err := library.ScanFile(f)
if err != nil {
return nil, xerrors.Errorf("failed to scan libraries in file: %w", err)
}
results := map[string][]vulnerability.DetectedVulnerability{
f.Name(): vulns,
results := report.Results{
{FileName: f.Name(), Vulnerabilities: vulns},
}
return results, nil
}

View File

@@ -6,8 +6,8 @@ import (
"github.com/aquasecurity/fanal/analyzer"
"github.com/knqyf263/go-version"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/knqyf263/go-version"
)
var (

View File

@@ -3,8 +3,8 @@ package types
import (
"time"
"github.com/caarlos0/env/v6"
"github.com/aquasecurity/fanal/types"
"github.com/caarlos0/env/v6"
)
type DockerConfig struct {

View File

@@ -1,5 +1,8 @@
package types
import "time"
type ScanOptions struct {
VulnType []string
Timeout time.Duration
}

View File

@@ -1 +1,12 @@
package types
import "github.com/aquasecurity/trivy-db/pkg/types"
type DetectedVulnerability struct {
VulnerabilityID string `json:",omitempty"`
PkgName string `json:",omitempty"`
InstalledVersion string `json:",omitempty"`
FixedVersion string `json:",omitempty"`
types.Vulnerability
}

View File

@@ -37,6 +37,7 @@ func (s *Spinner) Stop() {
s.client.Stop()
}
// TODO: Expose an interface for progressbar
type ProgressBar struct {
client *pb.ProgressBar
}

View File

@@ -32,6 +32,9 @@ func SetCacheDir(dir string) {
func FileWalk(root string, targetFiles map[string]struct{}, walkFn func(r io.Reader, path string) error) error {
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if info.IsDir() {
return nil
}
@@ -51,10 +54,10 @@ func FileWalk(root string, targetFiles map[string]struct{}, walkFn func(r io.Rea
}
f, err := os.Open(path)
defer f.Close()
if err != nil {
return xerrors.Errorf("failed to open file: %w", err)
}
defer f.Close()
if err = walkFn(f, path); err != nil {
return err

View File

@@ -0,0 +1,100 @@
package vulnerability
import (
"bufio"
"os"
"sort"
"strings"
"github.com/aquasecurity/trivy-db/pkg/db"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/types"
"github.com/aquasecurity/trivy/pkg/utils"
)
const (
DefaultIgnoreFile = ".trivyignore"
)
type Client struct {
dbc db.Operations
}
func NewClient() Client {
return Client{
dbc: db.Config{},
}
}
func (c Client) FillAndFilter(vulns []types.DetectedVulnerability, severities []dbTypes.Severity,
ignoreUnfixed bool, ignoreFile string, light bool) []types.DetectedVulnerability {
var err error
var severity dbTypes.Severity
ignoredIDs := getIgnoredIDs(ignoreFile)
var vulnerabilities []types.DetectedVulnerability
for _, vuln := range vulns {
var vulnerability dbTypes.Vulnerability
if light {
severity, err = c.dbc.GetSeverity(vuln.VulnerabilityID)
vulnerability.Severity = severity.String()
} else {
vulnerability, err = c.dbc.GetVulnerability(vuln.VulnerabilityID)
}
if err != nil {
log.Logger.Warn(err)
continue
}
// Filter vulnerabilities by severity
for _, s := range severities {
if s.String() == vulnerability.Severity {
vuln.Vulnerability = vulnerability
// Ignore unfixed vulnerabilities
if ignoreUnfixed && vuln.FixedVersion == "" {
continue
} else if utils.StringInSlice(vuln.VulnerabilityID, ignoredIDs) {
continue
}
vulnerabilities = append(vulnerabilities, vuln)
break
}
}
}
sort.Slice(vulnerabilities, func(i, j int) bool {
if vulnerabilities[i].PkgName != vulnerabilities[j].PkgName {
return vulnerabilities[i].PkgName < vulnerabilities[j].PkgName
}
ret := dbTypes.CompareSeverityString(
vulnerabilities[j].Severity, vulnerabilities[i].Severity,
)
if ret != 0 {
return ret > 0
}
return vulnerabilities[i].VulnerabilityID < vulnerabilities[j].VulnerabilityID
})
return vulnerabilities
}
func getIgnoredIDs(ignoreFile string) []string {
f, err := os.Open(ignoreFile)
if err != nil {
// trivy must work even if no .trivyignore exist
return nil
}
var ignoredIDs []string
scanner := bufio.NewScanner(f)
for scanner.Scan() {
line := scanner.Text()
line = strings.TrimSpace(line)
if strings.HasPrefix(line, "#") || line == "" {
continue
}
ignoredIDs = append(ignoredIDs, line)
}
return ignoredIDs
}

View File

@@ -0,0 +1,190 @@
package vulnerability
import (
"testing"
"github.com/aquasecurity/trivy-db/pkg/db"
"github.com/stretchr/testify/assert"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/types"
)
func TestFillAndFilter(t *testing.T) {
detectedVulns := []types.DetectedVulnerability{
{
VulnerabilityID: "foo",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityNames[dbTypes.SeverityHigh],
},
},
{
VulnerabilityID: "piyo",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityNames[dbTypes.SeverityCritical],
},
},
{
VulnerabilityID: "bar",
PkgName: "barpkg",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityNames[dbTypes.SeverityLow],
},
},
{
VulnerabilityID: "hoge",
},
{
VulnerabilityID: "baz",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityNames[dbTypes.SeverityMedium],
},
},
}
severities := []dbTypes.Severity{dbTypes.SeverityLow, dbTypes.SeverityCritical,
dbTypes.SeverityMedium, dbTypes.SeverityHigh, dbTypes.SeverityUnknown}
mockDBConfig := new(db.MockDBConfig)
getVulnerability := map[string]dbTypes.Vulnerability{
"foo": {
Title: "footitle",
Description: "foodesc",
Severity: dbTypes.SeverityHigh.String(),
References: []string{"fooref"},
},
"bar": {
Title: "bartitle",
Description: "bardesc",
Severity: dbTypes.SeverityLow.String(),
References: []string{"barref"},
},
"baz": {
Title: "baztitle",
Description: "bazdesc",
Severity: dbTypes.SeverityMedium.String(),
References: []string{"bazref"},
},
"piyo": {
Title: "piyotitle",
Description: "piyodesc",
Severity: dbTypes.SeverityCritical.String(),
References: []string{"piyoref"},
},
"hoge": {
Title: "hogetitle",
Description: "hogedesc",
Severity: dbTypes.SeverityUnknown.String(),
References: []string{"hogeref"},
},
}
for pkgName, vulnerability := range getVulnerability {
mockDBConfig.On("GetVulnerability", pkgName).Return(vulnerability, nil)
}
getSeverity := map[string]dbTypes.Severity{
"foo": dbTypes.SeverityHigh,
"bar": dbTypes.SeverityLow,
"baz": dbTypes.SeverityMedium,
"piyo": dbTypes.SeverityCritical,
"hoge": dbTypes.SeverityUnknown,
}
for pkgName, severity := range getSeverity {
mockDBConfig.On("GetSeverity", pkgName).Return(severity, nil)
}
expected := []types.DetectedVulnerability{
{
VulnerabilityID: "piyo",
Vulnerability: dbTypes.Vulnerability{
Title: "piyotitle",
Description: "piyodesc",
Severity: dbTypes.SeverityNames[dbTypes.SeverityCritical],
References: []string{"piyoref"},
},
},
{
VulnerabilityID: "foo",
Vulnerability: dbTypes.Vulnerability{
Title: "footitle",
Description: "foodesc",
Severity: dbTypes.SeverityNames[dbTypes.SeverityHigh],
References: []string{"fooref"},
},
},
{
VulnerabilityID: "baz",
Vulnerability: dbTypes.Vulnerability{
Title: "baztitle",
Description: "bazdesc",
Severity: dbTypes.SeverityNames[dbTypes.SeverityMedium],
References: []string{"bazref"},
},
},
{
VulnerabilityID: "hoge",
Vulnerability: dbTypes.Vulnerability{
Title: "hogetitle",
Description: "hogedesc",
Severity: dbTypes.SeverityNames[dbTypes.SeverityUnknown],
References: []string{"hogeref"},
},
},
{
VulnerabilityID: "bar",
PkgName: "barpkg",
Vulnerability: dbTypes.Vulnerability{
Title: "bartitle",
Description: "bardesc",
Severity: dbTypes.SeverityNames[dbTypes.SeverityLow],
References: []string{"barref"},
},
},
}
client := Client{
dbc: mockDBConfig,
}
actual := client.FillAndFilter(detectedVulns, severities, false, ".trivyignore", false)
assert.Equal(t, expected, actual, "full db")
expected = []types.DetectedVulnerability{
{
VulnerabilityID: "piyo",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityNames[dbTypes.SeverityCritical],
},
},
{
VulnerabilityID: "foo",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityNames[dbTypes.SeverityHigh],
},
},
{
VulnerabilityID: "baz",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityNames[dbTypes.SeverityMedium],
},
},
{
VulnerabilityID: "hoge",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityNames[dbTypes.SeverityUnknown],
},
},
{
VulnerabilityID: "bar",
PkgName: "barpkg",
Vulnerability: dbTypes.Vulnerability{
Severity: dbTypes.SeverityNames[dbTypes.SeverityLow],
},
},
}
actual = client.FillAndFilter(detectedVulns, severities, false, ".trivyignore", true)
assert.Equal(t, expected, actual, "light db")
}

View File

@@ -1,111 +0,0 @@
package alpine
import (
"encoding/json"
"fmt"
"io"
"path/filepath"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy/pkg/log"
"golang.org/x/xerrors"
bolt "github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/utils"
)
const (
alpineDir = "alpine"
)
var (
platformFormat = "alpine %s"
)
func Update(dir string, updatedFiles map[string]struct{}) error {
rootDir := filepath.Join(dir, alpineDir)
targets, err := utils.FilterTargets(alpineDir, updatedFiles)
if err != nil {
return xerrors.Errorf("failed to filter target files: %w", err)
} else if len(targets) == 0 {
log.Logger.Debug("Alpine: no updated file")
return nil
}
log.Logger.Debugf("Alpine updated files: %d", len(targets))
bar := utils.PbStartNew(len(targets))
defer bar.Finish()
var cves []AlpineCVE
err = utils.FileWalk(rootDir, targets, func(r io.Reader, path string) error {
var cve AlpineCVE
if err = json.NewDecoder(r).Decode(&cve); err != nil {
return xerrors.Errorf("failed to decode Alpine JSON: %w", err)
}
cves = append(cves, cve)
bar.Increment()
return nil
})
if err != nil {
return xerrors.Errorf("error in Alpine walk: %w", err)
}
if err = save(cves); err != nil {
return xerrors.Errorf("error in Alpine save: %w", err)
}
return nil
}
func save(cves []AlpineCVE) error {
log.Logger.Debug("Saving Alpine DB")
err := db.BatchUpdate(func(tx *bolt.Tx) error {
for _, cve := range cves {
platformName := fmt.Sprintf(platformFormat, cve.Release)
pkgName := cve.Package
advisory := Advisory{
VulnerabilityID: cve.VulnerabilityID,
FixedVersion: cve.FixedVersion,
Repository: cve.Repository,
}
if err := db.PutNestedBucket(tx, platformName, pkgName, cve.VulnerabilityID, advisory); err != nil {
return xerrors.Errorf("failed to save alpine advisory: %w", err)
}
vuln := vulnerability.Vulnerability{
Title: cve.Subject,
Description: cve.Description,
}
if err := vulnerability.Put(tx, cve.VulnerabilityID, vulnerability.Alpine, vuln); err != nil {
return xerrors.Errorf("failed to save alpine vulnerability: %w", err)
}
}
return nil
})
if err != nil {
return xerrors.Errorf("error in db batch update: %w", err)
}
return nil
}
func Get(release string, pkgName string) ([]Advisory, error) {
bucket := fmt.Sprintf(platformFormat, release)
advisories, err := db.ForEach(bucket, pkgName)
if err != nil {
return nil, xerrors.Errorf("error in Alpine foreach: %w", err)
}
var results []Advisory
for _, v := range advisories {
var advisory Advisory
if err = json.Unmarshal(v, &advisory); err != nil {
return nil, xerrors.Errorf("failed to unmarshal Alpine JSON: %w", err)
}
results = append(results, advisory)
}
return results, nil
}

View File

@@ -1,17 +0,0 @@
package alpine
type AlpineCVE struct {
VulnerabilityID string
Release string
Package string
Repository string
FixedVersion string
Subject string
Description string
}
type Advisory struct {
VulnerabilityID string
FixedVersion string
Repository string
}

View File

@@ -1,164 +0,0 @@
package debianoval
import (
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"github.com/aquasecurity/trivy/pkg/vulnsrc/debian"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
bolt "github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy/pkg/log"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/utils"
)
var (
debianDir = filepath.Join("oval", "debian")
// e.g. debian oval 8
platformFormat = "debian oval %s"
)
func Update(dir string, updatedFiles map[string]struct{}) error {
rootDir := filepath.Join(dir, debianDir)
targets, err := utils.FilterTargets(debianDir, updatedFiles)
if err != nil {
return xerrors.Errorf("failed to filter target files: %w", err)
} else if len(targets) == 0 {
log.Logger.Debug("Debian OVAL: no updated file")
return nil
}
log.Logger.Debugf("Debian OVAL updated files: %d", len(targets))
bar := utils.PbStartNew(len(targets))
defer bar.Finish()
var cves []DebianOVAL
err = utils.FileWalk(rootDir, targets, func(r io.Reader, path string) error {
var cve DebianOVAL
if err = json.NewDecoder(r).Decode(&cve); err != nil {
return xerrors.Errorf("failed to decode Debian OVAL JSON: %w", err)
}
dirs := strings.Split(path, string(os.PathSeparator))
if len(dirs) < 3 {
log.Logger.Debugf("invalid path: %s", path)
return nil
}
cve.Release = dirs[len(dirs)-3]
cves = append(cves, cve)
bar.Increment()
return nil
})
if err != nil {
return xerrors.Errorf("error in Debian OVAL walk: %w", err)
}
if err = save(cves); err != nil {
return xerrors.Errorf("error in Debian OVAL save: %w", err)
}
return nil
}
// from https://github.com/kotakanbe/goval-dictionary/blob/c462c07a5cd0b6de52f167e9aa4298083edfc356/models/debian.go#L53
func walkDebian(cri Criteria, pkgs []Package) []Package {
for _, c := range cri.Criterions {
ss := strings.Split(c.Comment, " DPKG is earlier than ")
if len(ss) != 2 {
continue
}
// "0" means notyetfixed or erroneous information.
// Not available because "0" includes erroneous info...
if ss[1] == "0" {
continue
}
pkgs = append(pkgs, Package{
Name: ss[0],
FixedVersion: strings.Split(ss[1], " ")[0],
})
}
if len(cri.Criterias) == 0 {
return pkgs
}
for _, c := range cri.Criterias {
pkgs = walkDebian(c, pkgs)
}
return pkgs
}
func save(cves []DebianOVAL) error {
log.Logger.Debug("Saving Debian OVAL")
err := db.BatchUpdate(func(tx *bolt.Tx) error {
for _, cve := range cves {
affectedPkgs := walkDebian(cve.Criteria, []Package{})
for _, affectedPkg := range affectedPkgs {
// stretch => 9
majorVersion, ok := debian.DebianReleasesMapping[cve.Release]
if !ok {
continue
}
platformName := fmt.Sprintf(platformFormat, majorVersion)
cveID := cve.Metadata.Title
advisory := vulnerability.Advisory{
VulnerabilityID: cveID,
FixedVersion: affectedPkg.FixedVersion,
}
if err := db.PutNestedBucket(tx, platformName, affectedPkg.Name, cveID, advisory); err != nil {
return xerrors.Errorf("failed to save Debian OVAL advisory: %w", err)
}
var references []string
for _, ref := range cve.Metadata.References {
references = append(references, ref.RefURL)
}
vuln := vulnerability.Vulnerability{
Description: cve.Metadata.Description,
References: references,
}
if err := vulnerability.Put(tx, cveID, vulnerability.DebianOVAL, vuln); err != nil {
return xerrors.Errorf("failed to save Debian OVAL vulnerability: %w", err)
}
}
}
return nil
})
if err != nil {
return xerrors.Errorf("error in batch update: %w", err)
}
return nil
}
func Get(release string, pkgName string) ([]vulnerability.Advisory, error) {
bucket := fmt.Sprintf(platformFormat, release)
advisories, err := db.ForEach(bucket, pkgName)
if err != nil {
return nil, xerrors.Errorf("error in Debian OVAL foreach: %w", err)
}
if len(advisories) == 0 {
return nil, nil
}
var results []vulnerability.Advisory
for _, v := range advisories {
var advisory vulnerability.Advisory
if err = json.Unmarshal(v, &advisory); err != nil {
return nil, xerrors.Errorf("failed to unmarshal Debian OVAL JSON: %w", err)
}
results = append(results, advisory)
}
return results, nil
}

View File

@@ -1,43 +0,0 @@
package debianoval
type DebianOVAL struct {
Metadata Metadata
Criteria Criteria
Release string
}
type Metadata struct {
Title string
AffectedList []Affected
Description string
References []Reference
}
type Affected struct {
Family string
Platform string
Product string
}
type Criteria struct {
Operator string
Criterias []Criteria
Criterions []Criterion
}
type Reference struct {
Source string
RefID string
RefURL string
}
type Criterion struct {
Negate bool
TestRef string
Comment string
}
type Package struct {
Name string
FixedVersion string
}

View File

@@ -1,154 +0,0 @@
package debian
import (
"encoding/json"
"fmt"
"io"
"path/filepath"
"strings"
bolt "github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/xerrors"
)
const (
debianDir = "debian"
)
var (
// e.g. debian 8
platformFormat = "debian %s"
DebianReleasesMapping = map[string]string{
// Code names
"squeeze": "6",
"wheezy": "7",
"jessie": "8",
"stretch": "9",
"buster": "10",
"sid": "unstable",
}
)
func Update(dir string, updatedFiles map[string]struct{}) error {
rootDir := filepath.Join(dir, debianDir)
targets, err := utils.FilterTargets(debianDir, updatedFiles)
if err != nil {
return xerrors.Errorf("failed to filter target files: %w", err)
} else if len(targets) == 0 {
log.Logger.Debug("Debian: no updated file")
return nil
}
log.Logger.Debugf("Debian updated files: %d", len(targets))
bar := utils.PbStartNew(len(targets))
defer bar.Finish()
var cves []DebianCVE
err = utils.FileWalk(rootDir, targets, func(r io.Reader, path string) error {
var cve DebianCVE
if err = json.NewDecoder(r).Decode(&cve); err != nil {
return xerrors.Errorf("failed to decode Debian JSON: %w", err)
}
cve.VulnerabilityID = strings.TrimSuffix(filepath.Base(path), ".json")
cve.Package = filepath.Base(filepath.Dir(path))
cves = append(cves, cve)
bar.Increment()
return nil
})
if err != nil {
return xerrors.Errorf("error in Debian walk: %w", err)
}
if err = save(cves); err != nil {
return xerrors.Errorf("error in Debian save: %w", err)
}
return nil
}
func save(cves []DebianCVE) error {
log.Logger.Debug("Saving Debian DB")
err := db.BatchUpdate(func(tx *bolt.Tx) error {
for _, cve := range cves {
for _, release := range cve.Releases {
for releaseStr := range release.Repositories {
majorVersion, ok := DebianReleasesMapping[releaseStr]
if !ok {
continue
}
platformName := fmt.Sprintf(platformFormat, majorVersion)
if release.Status != "open" {
continue
}
advisory := vulnerability.Advisory{
VulnerabilityID: cve.VulnerabilityID,
//Severity: severityFromUrgency(release.Urgency),
}
if err := db.PutNestedBucket(tx, platformName, cve.Package, cve.VulnerabilityID, advisory); err != nil {
return xerrors.Errorf("failed to save Debian advisory: %w", err)
}
vuln := vulnerability.Vulnerability{
Severity: severityFromUrgency(release.Urgency),
Description: cve.Description,
}
if err := vulnerability.Put(tx, cve.VulnerabilityID, vulnerability.Debian, vuln); err != nil {
return xerrors.Errorf("failed to save Debian vulnerability: %w", err)
}
}
}
}
return nil
})
if err != nil {
return xerrors.Errorf("error in batch update: %w", err)
}
return nil
}
func Get(release string, pkgName string) ([]vulnerability.Advisory, error) {
bucket := fmt.Sprintf(platformFormat, release)
advisories, err := db.ForEach(bucket, pkgName)
if err != nil {
return nil, xerrors.Errorf("error in Debian foreach: %w", err)
}
if len(advisories) == 0 {
return nil, nil
}
var results []vulnerability.Advisory
for _, v := range advisories {
var advisory vulnerability.Advisory
if err = json.Unmarshal(v, &advisory); err != nil {
return nil, xerrors.Errorf("failed to unmarshal Debian JSON: %w", err)
}
results = append(results, advisory)
}
return results, nil
}
func severityFromUrgency(urgency string) vulnerability.Severity {
switch urgency {
case "not yet assigned":
return vulnerability.SeverityUnknown
case "end-of-life", "unimportant", "low", "low*", "low**":
return vulnerability.SeverityLow
case "medium", "medium*", "medium**":
return vulnerability.SeverityMedium
case "high", "high*", "high**":
return vulnerability.SeverityHigh
default:
return vulnerability.SeverityUnknown
}
}

View File

@@ -1,15 +0,0 @@
package debian
type DebianCVE struct {
Description string `json:"description"`
Releases map[string]Release `json:"releases"`
Scope string `json:"scope"`
Package string
VulnerabilityID string
}
type Release struct {
Repositories map[string]string `json:"repositories"`
Status string `json:"status"`
Urgency string `json:"urgency"`
}

View File

@@ -1,106 +0,0 @@
package nvd
import (
"bytes"
"encoding/json"
"io"
"path/filepath"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/utils"
bolt "github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
)
const (
nvdDir = "nvd"
)
func Update(dir string, updatedFiles map[string]struct{}) error {
rootDir := filepath.Join(dir, nvdDir)
targets, err := utils.FilterTargets(nvdDir, updatedFiles)
if err != nil {
return xerrors.Errorf("failed to filter target files: %w", err)
} else if len(targets) == 0 {
log.Logger.Debug("NVD: no updated file")
return nil
}
log.Logger.Debugf("NVD updated files: %d", len(targets))
bar := utils.PbStartNew(len(targets))
defer bar.Finish()
var items []Item
buffer := &bytes.Buffer{}
err = utils.FileWalk(rootDir, targets, func(r io.Reader, _ string) error {
item := Item{}
if _, err := buffer.ReadFrom(r); err != nil {
return xerrors.Errorf("failed to read file: %w", err)
}
if err := json.Unmarshal(buffer.Bytes(), &item); err != nil {
return xerrors.Errorf("failed to decode NVD JSON: %w", err)
}
buffer.Reset()
items = append(items, item)
bar.Increment()
return nil
})
if err != nil {
return xerrors.Errorf("error in NVD walk: %w", err)
}
if err = save(items); err != nil {
return xerrors.Errorf("error in NVD save: %w", err)
}
return nil
}
func save(items []Item) error {
log.Logger.Debug("NVD batch update")
err := vulnerability.BatchUpdate(func(b *bolt.Bucket) error {
for _, item := range items {
cveID := item.Cve.Meta.ID
severity, _ := vulnerability.NewSeverity(item.Impact.BaseMetricV2.Severity)
severityV3, _ := vulnerability.NewSeverity(item.Impact.BaseMetricV3.CvssV3.BaseSeverity)
var references []string
for _, ref := range item.Cve.References.ReferenceDataList {
references = append(references, ref.URL)
}
var description string
for _, d := range item.Cve.Description.DescriptionDataList {
if d.Value != "" {
description = d.Value
break
}
}
vuln := vulnerability.Vulnerability{
CvssScore: item.Impact.BaseMetricV2.CvssV2.BaseScore,
CvssScoreV3: item.Impact.BaseMetricV3.CvssV3.BaseScore,
Severity: severity,
SeverityV3: severityV3,
References: references,
Title: "",
Description: description,
}
if err := db.Put(b, cveID, vulnerability.Nvd, vuln); err != nil {
return err
}
}
return nil
})
if err != nil {
return xerrors.Errorf("error in batch update: %w", err)
}
return nil
}

View File

@@ -1,61 +0,0 @@
package nvd
type NVD struct {
CVEItems []Item `json:"CVE_Items"`
}
type Item struct {
Cve Cve
Impact Impact
}
type Cve struct {
Meta Meta `json:"CVE_data_meta"`
References References
Description Description
}
type Meta struct {
ID string
}
type Impact struct {
BaseMetricV2 BaseMetricV2
BaseMetricV3 BaseMetricV3
}
type BaseMetricV2 struct {
CvssV2 CvssV2
Severity string
}
type CvssV2 struct {
BaseScore float64
}
type BaseMetricV3 struct {
CvssV3 CvssV3
}
type CvssV3 struct {
BaseScore float64
BaseSeverity string
}
type References struct {
ReferenceDataList []ReferenceData `json:"reference_data"`
}
type ReferenceData struct {
Name string
Refsource string
URL string
}
type Description struct {
DescriptionDataList []DescriptionData `json:"description_data"`
}
type DescriptionData struct {
Lang string
Value string
}

View File

@@ -1,247 +0,0 @@
package redhat
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"path/filepath"
"strconv"
"strings"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/log"
bolt "github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy/pkg/utils"
"golang.org/x/xerrors"
)
const (
redhatDir = "redhat"
platformFormat = "Red Hat Enterprise Linux %s"
)
var (
targetPlatforms = []string{"Red Hat Enterprise Linux 5", "Red Hat Enterprise Linux 6", "Red Hat Enterprise Linux 7"}
targetStatus = []string{"Affected", "Fix deferred", "Will not fix"}
)
func Update(dir string, updatedFiles map[string]struct{}) error {
rootDir := filepath.Join(dir, redhatDir)
targets, err := utils.FilterTargets(redhatDir, updatedFiles)
if err != nil {
return xerrors.Errorf("failed to filter target files: %w", err)
} else if len(targets) == 0 {
log.Logger.Debug("Red Hat: no updated file")
return nil
}
log.Logger.Debugf("Red Hat updated files: %d", len(targets))
bar := utils.PbStartNew(len(targets))
defer bar.Finish()
var cves []RedhatCVE
err = utils.FileWalk(rootDir, targets, func(r io.Reader, _ string) error {
content, err := ioutil.ReadAll(r)
if err != nil {
return err
}
cve := RedhatCVE{}
if err = json.Unmarshal(content, &cve); err != nil {
return xerrors.Errorf("failed to decode RedHat JSON: %w", err)
}
switch cve.TempAffectedRelease.(type) {
case []interface{}:
var ar RedhatCVEAffectedReleaseArray
if err = json.Unmarshal(content, &ar); err != nil {
return xerrors.Errorf("unknown affected_release type: %w", err)
}
cve.AffectedRelease = ar.AffectedRelease
case map[string]interface{}:
var ar RedhatCVEAffectedReleaseObject
if err = json.Unmarshal(content, &ar); err != nil {
return xerrors.Errorf("unknown affected_release type: %w", err)
}
cve.AffectedRelease = []RedhatAffectedRelease{ar.AffectedRelease}
case nil:
default:
return xerrors.New("unknown affected_release type")
}
switch cve.TempPackageState.(type) {
case []interface{}:
var ps RedhatCVEPackageStateArray
if err = json.Unmarshal(content, &ps); err != nil {
return xerrors.Errorf("unknown package_state type: %w", err)
}
cve.PackageState = ps.PackageState
case map[string]interface{}:
var ps RedhatCVEPackageStateObject
if err = json.Unmarshal(content, &ps); err != nil {
return xerrors.Errorf("unknown package_state type: %w", err)
}
cve.PackageState = []RedhatPackageState{ps.PackageState}
case nil:
default:
return xerrors.New("unknown package_state type")
}
cves = append(cves, cve)
bar.Increment()
return nil
})
if err != nil {
return xerrors.Errorf("error in RedHat walk: %w", err)
}
if err = save(cves); err != nil {
return xerrors.Errorf("error in RedHat save: %w", err)
}
return nil
}
// platformName: pkgStatus
type platform map[string]pkg
// pkgName: advisoryStatus
type pkg map[string]advisory
// cveID: version
type advisory map[string]interface{}
func save(cves []RedhatCVE) error {
log.Logger.Debug("Saving RedHat DB")
err := db.BatchUpdate(func(tx *bolt.Tx) error {
for _, cve := range cves {
for _, affected := range cve.AffectedRelease {
if affected.Package == "" {
continue
}
// e.g. Red Hat Enterprise Linux 7
platformName := affected.ProductName
if !utils.StringInSlice(affected.ProductName, targetPlatforms) {
continue
}
pkgName, version := splitPkgName(affected.Package)
advisory := vulnerability.Advisory{
VulnerabilityID: cve.Name,
FixedVersion: version,
}
if err := db.PutNestedBucket(tx, platformName, pkgName, cve.Name, advisory); err != nil {
return xerrors.Errorf("failed to save Red Hat advisory: %w", err)
}
}
for _, pkgState := range cve.PackageState {
pkgName := pkgState.PackageName
if pkgName == "" {
continue
}
// e.g. Red Hat Enterprise Linux 7
platformName := pkgState.ProductName
if !utils.StringInSlice(platformName, targetPlatforms) {
continue
}
if !utils.StringInSlice(pkgState.FixState, targetStatus) {
continue
}
advisory := vulnerability.Advisory{
// this means all versions
FixedVersion: "",
VulnerabilityID: cve.Name,
}
if err := db.PutNestedBucket(tx, platformName, pkgName, cve.Name, advisory); err != nil {
return xerrors.Errorf("failed to save Red Hat advisory: %w", err)
}
}
cvssScore, _ := strconv.ParseFloat(cve.Cvss.CvssBaseScore, 64)
cvss3Score, _ := strconv.ParseFloat(cve.Cvss3.Cvss3BaseScore, 64)
title := strings.TrimPrefix(strings.TrimSpace(cve.Bugzilla.Description), cve.Name)
vuln := vulnerability.Vulnerability{
CvssScore: cvssScore,
CvssScoreV3: cvss3Score,
Severity: severityFromThreat(cve.ThreatSeverity),
References: cve.References,
Title: strings.TrimSpace(title),
Description: strings.TrimSpace(strings.Join(cve.Details, "")),
}
if err := vulnerability.Put(tx, cve.Name, vulnerability.RedHat, vuln); err != nil {
return xerrors.Errorf("failed to save Red Hat vulnerability: %w", err)
}
}
return nil
})
if err != nil {
return err
}
return nil
}
func Get(majorVersion string, pkgName string) ([]vulnerability.Advisory, error) {
bucket := fmt.Sprintf(platformFormat, majorVersion)
advisories, err := db.ForEach(bucket, pkgName)
if err != nil {
return nil, xerrors.Errorf("error in Red Hat foreach: %w", err)
}
if len(advisories) == 0 {
return nil, nil
}
var results []vulnerability.Advisory
for _, v := range advisories {
var advisory vulnerability.Advisory
if err = json.Unmarshal(v, &advisory); err != nil {
return nil, xerrors.Errorf("failed to unmarshal Red Hat JSON: %w", err)
}
results = append(results, advisory)
}
return results, nil
}
// ref. https://github.com/rpm-software-management/yum/blob/043e869b08126c1b24e392f809c9f6871344c60d/rpmUtils/miscutils.py#L301
func splitPkgName(pkgName string) (string, string) {
var version string
// Trim release
index := strings.LastIndex(pkgName, "-")
if index == -1 {
return "", ""
}
version = pkgName[index:]
pkgName = pkgName[:index]
// Trim version
index = strings.LastIndex(pkgName, "-")
if index == -1 {
return "", ""
}
version = pkgName[index+1:] + version
pkgName = pkgName[:index]
return pkgName, version
}
func severityFromThreat(sev string) vulnerability.Severity {
switch strings.Title(sev) {
case "Low":
return vulnerability.SeverityLow
case "Moderate":
return vulnerability.SeverityMedium
case "Important":
return vulnerability.SeverityHigh
case "Critical":
return vulnerability.SeverityCritical
}
return vulnerability.SeverityUnknown
}

View File

@@ -1,80 +0,0 @@
package redhat
type RedhatCVE struct {
ThreatSeverity string `json:"threat_severity"`
PublicDate string `json:"public_date"`
Bugzilla RedhatBugzilla `json:"bugzilla"`
Cvss RedhatCvss `json:"cvss"`
Cvss3 RedhatCvss3 `json:"cvss3"`
Iava string `json:"iava"`
Cwe string `json:"cwe"`
Statement string `json:"statement"`
Acknowledgement string `json:"acknowledgement"`
Mitigation string `json:"mitigation"`
TempAffectedRelease interface{} `json:"affected_release"` // affected_release is array or object
AffectedRelease []RedhatAffectedRelease
TempPackageState interface{} `json:"package_state"` // package_state is array or object
PackageState []RedhatPackageState
Name string `json:"name"`
DocumentDistribution string `json:"document_distribution"`
Details []string `json:"details"`
References []string `json:"references"`
}
type RedhatCVEAffectedReleaseArray struct {
AffectedRelease []RedhatAffectedRelease `json:"affected_release"`
}
type RedhatCVEAffectedReleaseObject struct {
AffectedRelease RedhatAffectedRelease `json:"affected_release"`
}
type RedhatCVEPackageStateArray struct {
PackageState []RedhatPackageState `json:"package_state"`
}
type RedhatCVEPackageStateObject struct {
PackageState RedhatPackageState `json:"package_state"`
}
type RedhatDetail struct {
Detail string `sql:"type:text"`
}
type RedhatReference struct {
Reference string `sql:"type:text"`
}
type RedhatBugzilla struct {
Description string `json:"description" sql:"type:text"`
BugzillaID string `json:"id"`
URL string `json:"url"`
}
type RedhatCvss struct {
CvssBaseScore string `json:"cvss_base_score"`
CvssScoringVector string `json:"cvss_scoring_vector"`
Status string `json:"status"`
}
type RedhatCvss3 struct {
Cvss3BaseScore string `json:"cvss3_base_score"`
Cvss3ScoringVector string `json:"cvss3_scoring_vector"`
Status string `json:"status"`
}
type RedhatAffectedRelease struct {
ProductName string `json:"product_name"`
ReleaseDate string `json:"release_date"`
Advisory string `json:"advisory"`
Package string `json:"package"`
Cpe string `json:"cpe"`
}
type RedhatPackageState struct {
ProductName string `json:"product_name"`
FixState string `json:"fix_state"`
PackageName string `json:"package_name"`
Cpe string `json:"cpe"`
}

View File

@@ -1,18 +0,0 @@
package ubuntu
type UbuntuCVE struct {
Description string `json:"description"`
Candidate string
Priority string
Patches map[PackageName]Patch
References []string
}
type PackageName string
type Release string
type Patch map[Release]Status
type Status struct {
Status string
Note string
}

View File

@@ -1,164 +0,0 @@
package ubuntu
import (
"encoding/json"
"fmt"
"io"
"path/filepath"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"github.com/aquasecurity/trivy/pkg/log"
bolt "github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/utils"
)
const (
ubuntuDir = "ubuntu"
platformFormat = "ubuntu %s"
t
)
var (
targetStatus = []string{"needed", "deferred", "released"}
UbuntuReleasesMapping = map[string]string{
"precise": "12.04",
"quantal": "12.10",
"raring": "13.04",
"trusty": "14.04",
"utopic": "14.10",
"vivid": "15.04",
"wily": "15.10",
"xenial": "16.04",
"yakkety": "16.10",
"zesty": "17.04",
"artful": "17.10",
"bionic": "18.04",
"cosmic": "18.10",
"disco": "19.04",
}
)
func Update(dir string, updatedFiles map[string]struct{}) error {
rootDir := filepath.Join(dir, ubuntuDir)
targets, err := utils.FilterTargets(ubuntuDir, updatedFiles)
if err != nil {
return xerrors.Errorf("failed to filter target files: %w", err)
} else if len(targets) == 0 {
log.Logger.Debug("Ubuntu: no updated file")
return nil
}
log.Logger.Debugf("Ubuntu OVAL updated files: %d", len(targets))
bar := utils.PbStartNew(len(targets))
defer bar.Finish()
var cves []UbuntuCVE
err = utils.FileWalk(rootDir, targets, func(r io.Reader, path string) error {
var cve UbuntuCVE
if err = json.NewDecoder(r).Decode(&cve); err != nil {
return xerrors.Errorf("failed to decode Ubuntu JSON: %w", err)
}
cves = append(cves, cve)
bar.Increment()
return nil
})
if err != nil {
return xerrors.Errorf("error in Ubuntu walk: %w", err)
}
if err = save(cves); err != nil {
return xerrors.Errorf("error in Ubuntu save: %w", err)
}
return nil
}
func save(cves []UbuntuCVE) error {
log.Logger.Debug("Saving Ubuntu DB")
err := db.BatchUpdate(func(tx *bolt.Tx) error {
for _, cve := range cves {
for packageName, patch := range cve.Patches {
pkgName := string(packageName)
for release, status := range patch {
if !utils.StringInSlice(status.Status, targetStatus) {
continue
}
osVersion, ok := UbuntuReleasesMapping[string(release)]
if !ok {
continue
}
platformName := fmt.Sprintf(platformFormat, osVersion)
advisory := vulnerability.Advisory{
VulnerabilityID: cve.Candidate,
}
if status.Status == "released" {
advisory.FixedVersion = status.Note
}
if err := db.PutNestedBucket(tx, platformName, pkgName, cve.Candidate, advisory); err != nil {
return xerrors.Errorf("failed to save Ubuntu advisory: %w", err)
}
vuln := vulnerability.Vulnerability{
Severity: severityFromPriority(cve.Priority),
References: cve.References,
Description: cve.Description,
// TODO
Title: "",
}
if err := vulnerability.Put(tx, cve.Candidate, vulnerability.Ubuntu, vuln); err != nil {
return xerrors.Errorf("failed to save Ubuntu vulnerability: %w", err)
}
}
}
}
return nil
})
if err != nil {
return xerrors.Errorf("error in batch update: %w", err)
}
return nil
}
func Get(release string, pkgName string) ([]vulnerability.Advisory, error) {
bucket := fmt.Sprintf(platformFormat, release)
advisories, err := db.ForEach(bucket, pkgName)
if err != nil {
return nil, xerrors.Errorf("error in Ubuntu foreach: %w", err)
}
if len(advisories) == 0 {
return nil, nil
}
var results []vulnerability.Advisory
for _, v := range advisories {
var advisory vulnerability.Advisory
if err = json.Unmarshal(v, &advisory); err != nil {
return nil, xerrors.Errorf("failed to unmarshal Ubuntu JSON: %w", err)
}
results = append(results, advisory)
}
return results, nil
}
func severityFromPriority(priority string) vulnerability.Severity {
switch priority {
case "untriaged":
return vulnerability.SeverityUnknown
case "negligible", "low":
return vulnerability.SeverityLow
case "medium":
return vulnerability.SeverityMedium
case "high":
return vulnerability.SeverityHigh
case "critical":
return vulnerability.SeverityCritical
default:
return vulnerability.SeverityUnknown
}
}

View File

@@ -1,19 +0,0 @@
package vulnerability
const (
// Data source
Nvd = "nvd"
RedHat = "redhat"
Debian = "debian"
DebianOVAL = "debian-oval"
Ubuntu = "ubuntu"
CentOS = "centos"
Fedora = "fedora"
Amazon = "amazon"
Alpine = "alpine"
RubySec = "ruby-advisory-db"
RustSec = "rust-advisory-db"
PhpSecurityAdvisories = "php-security-advisories"
NodejsSecurityWg = "nodejs-security-wg"
PythonSafetyDB = "python-safety-db"
)

View File

@@ -1,55 +0,0 @@
package vulnerability
import (
"encoding/json"
bolt "github.com/etcd-io/bbolt"
"github.com/aquasecurity/trivy/pkg/db"
"golang.org/x/xerrors"
)
const (
rootBucket = "vulnerability"
)
func Put(tx *bolt.Tx, cveID, source string, vuln Vulnerability) error {
root, err := tx.CreateBucketIfNotExists([]byte(rootBucket))
if err != nil {
return err
}
return db.Put(root, cveID, source, vuln)
}
func Update(cveID, source string, vuln Vulnerability) error {
return db.Update(rootBucket, cveID, source, vuln)
}
func BatchUpdate(fn func(b *bolt.Bucket) error) error {
return db.BatchUpdate(func(tx *bolt.Tx) error {
root, err := tx.CreateBucketIfNotExists([]byte(rootBucket))
if err != nil {
return err
}
return fn(root)
})
}
func Get(cveID string) (map[string]Vulnerability, error) {
values, err := db.ForEach(rootBucket, cveID)
if err != nil {
return nil, xerrors.Errorf("error in NVD get: %w", err)
}
if len(values) == 0 {
return nil, nil
}
vulns := map[string]Vulnerability{}
for source, value := range values {
var vuln Vulnerability
if err = json.Unmarshal(value, &vuln); err != nil {
return nil, xerrors.Errorf("failed to unmarshal Vulnerability JSON: %w", err)
}
vulns[source] = vuln
}
return vulns, nil
}

View File

@@ -1,94 +0,0 @@
package vulnerability
import (
"fmt"
"time"
"github.com/fatih/color"
)
type Severity int
const (
SeverityUnknown Severity = iota
SeverityLow
SeverityMedium
SeverityHigh
SeverityCritical
)
var (
SeverityNames = []string{
"UNKNOWN",
"LOW",
"MEDIUM",
"HIGH",
"CRITICAL",
}
SeverityColor = []func(a ...interface{}) string{
color.New(color.FgCyan).SprintFunc(),
color.New(color.FgBlue).SprintFunc(),
color.New(color.FgYellow).SprintFunc(),
color.New(color.FgHiRed).SprintFunc(),
color.New(color.FgRed).SprintFunc(),
}
)
func NewSeverity(severity string) (Severity, error) {
for i, name := range SeverityNames {
if severity == name {
return Severity(i), nil
}
}
return SeverityUnknown, fmt.Errorf("unknown severity: %s", severity)
}
func CompareSeverityString(sev1, sev2 string) bool {
s1, _ := NewSeverity(sev1)
s2, _ := NewSeverity(sev2)
return s1 < s2
}
func ColorizeSeverity(severity string) string {
for i, name := range SeverityNames {
if severity == name {
return SeverityColor[i](severity)
}
}
return color.New(color.FgBlue).SprintFunc()(severity)
}
func (s Severity) String() string {
return SeverityNames[s]
}
type LastUpdated struct {
Date time.Time
}
type Vulnerability struct {
ID string // e.g. CVE-2019-8331, OSVDB-104365
CvssScore float64
CvssScoreV3 float64
Severity Severity
SeverityV3 Severity
References []string
Title string
Description string
}
type Advisory struct {
VulnerabilityID string
FixedVersion string
}
type DetectedVulnerability struct {
VulnerabilityID string
PkgName string
InstalledVersion string
FixedVersion string
Title string
Description string
Severity string
References []string
}

View File

@@ -1,165 +0,0 @@
package vulnerability
import (
"bufio"
"fmt"
"os"
"strings"
"github.com/aquasecurity/trivy/pkg/utils"
"sort"
"github.com/aquasecurity/trivy/pkg/log"
)
const (
trivyIgnore = ".trivyignore"
)
var (
sources = []string{Nvd, RedHat, Debian, DebianOVAL, Alpine,
RubySec, RustSec, PhpSecurityAdvisories, NodejsSecurityWg, PythonSafetyDB}
)
func FillAndFilter(vulns []DetectedVulnerability, severities []Severity, ignoreUnfixed bool) []DetectedVulnerability {
ignoredIDs := getIgnoredIDs()
var vulnerabilities []DetectedVulnerability
for _, vuln := range vulns {
sev, title, description, references := getDetail(vuln.VulnerabilityID)
// Filter vulnerabilities by severity
for _, s := range severities {
if s == sev {
vuln.Severity = fmt.Sprint(sev)
vuln.Title = title
vuln.Description = description
vuln.References = references
// Ignore unfixed vulnerabilities
if ignoreUnfixed && vuln.FixedVersion == "" {
continue
} else if utils.StringInSlice(vuln.VulnerabilityID, ignoredIDs) {
continue
}
vulnerabilities = append(vulnerabilities, vuln)
break
}
}
}
sort.Slice(vulnerabilities, func(i, j int) bool {
if vulnerabilities[i].PkgName != vulnerabilities[j].PkgName {
return vulnerabilities[i].PkgName < vulnerabilities[j].PkgName
}
return CompareSeverityString(vulnerabilities[j].Severity, vulnerabilities[i].Severity)
})
return vulnerabilities
}
func getIgnoredIDs() []string {
f, err := os.Open(trivyIgnore)
if err != nil {
// trivy must work even if no .trivyignore exist
return nil
}
var ignoredIDs []string
scanner := bufio.NewScanner(f)
for scanner.Scan() {
line := scanner.Text()
line = strings.TrimSpace(line)
if strings.HasPrefix(line, "#") || line == "" {
continue
}
ignoredIDs = append(ignoredIDs, line)
}
return ignoredIDs
}
func getDetail(vulnID string) (Severity, string, string, []string) {
details, err := Get(vulnID)
if err != nil {
log.Logger.Debug(err)
return SeverityUnknown, "", "", nil
} else if len(details) == 0 {
return SeverityUnknown, "", "", nil
}
return getSeverity(details), getTitle(details), getDescription(details), getReferences(details)
}
func getSeverity(details map[string]Vulnerability) Severity {
for _, source := range sources {
switch d, ok := details[source]; {
case !ok:
continue
case d.CvssScore > 0:
return scoreToSeverity(d.CvssScore)
case d.CvssScoreV3 > 0:
return scoreToSeverity(d.CvssScoreV3)
case d.Severity != 0:
return d.Severity
case d.SeverityV3 != 0:
return d.SeverityV3
}
}
return SeverityUnknown
}
func getTitle(details map[string]Vulnerability) string {
for _, source := range sources {
d, ok := details[source]
if !ok {
continue
}
if d.Title != "" {
return d.Title
}
}
return ""
}
func getDescription(details map[string]Vulnerability) string {
for _, source := range sources {
d, ok := details[source]
if !ok {
continue
}
if d.Description != "" {
return d.Description
}
}
return ""
}
func getReferences(details map[string]Vulnerability) []string {
references := map[string]struct{}{}
for _, source := range sources {
d, ok := details[source]
if !ok {
continue
}
for _, ref := range d.References {
references[ref] = struct{}{}
}
}
var refs []string
for ref := range references {
refs = append(refs, ref)
}
return refs
}
func scoreToSeverity(score float64) Severity {
switch {
case score >= 9.0:
return SeverityCritical
case score >= 7.0:
return SeverityHigh
case score >= 4.0:
return SeverityMedium
case score > 0.0:
return SeverityLow
default:
return SeverityUnknown
}
}

View File

@@ -1,72 +0,0 @@
package vulnsrc
import (
"path/filepath"
"github.com/aquasecurity/trivy/pkg/git"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/alpine"
"github.com/aquasecurity/trivy/pkg/vulnsrc/debian"
debianoval "github.com/aquasecurity/trivy/pkg/vulnsrc/debian-oval"
"github.com/aquasecurity/trivy/pkg/vulnsrc/nvd"
"github.com/aquasecurity/trivy/pkg/vulnsrc/redhat"
"github.com/aquasecurity/trivy/pkg/vulnsrc/ubuntu"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
"golang.org/x/xerrors"
)
const (
repoURL = "https://github.com/aquasecurity/vuln-list.git"
)
type updateFunc func(dir string, updatedFiles map[string]struct{}) error
var (
// UpdateList has list of update distributions
UpdateList []string
updateMap = map[string]updateFunc{
vulnerability.Nvd: nvd.Update,
vulnerability.Alpine: alpine.Update,
vulnerability.RedHat: redhat.Update,
vulnerability.Debian: debian.Update,
vulnerability.DebianOVAL: debianoval.Update,
vulnerability.Ubuntu: ubuntu.Update,
}
)
func init() {
UpdateList = make([]string, 0, len(updateMap))
for distribution := range updateMap {
UpdateList = append(UpdateList, distribution)
}
}
func Update(names []string) error {
log.Logger.Info("Updating vulnerability database...")
// Clone vuln-list repository
dir := filepath.Join(utils.CacheDir(), "vuln-list")
updatedFiles, err := git.CloneOrPull(repoURL, dir)
if err != nil {
return xerrors.Errorf("error in vulnsrc clone or pull: %w", err)
}
log.Logger.Debugf("total updated files: %d", len(updatedFiles))
// Only last_updated.json
if len(updatedFiles) <= 1 {
return nil
}
for _, distribution := range names {
updateFunc, ok := updateMap[distribution]
if !ok {
return xerrors.Errorf("%s does not supported yet", distribution)
}
log.Logger.Infof("Updating %s data...", distribution)
if err := updateFunc(dir, updatedFiles); err != nil {
return xerrors.Errorf("error in %s update: %w", distribution, err)
}
}
return nil
}

View File

@@ -1,38 +0,0 @@
package vulnsrc
import (
"path/filepath"
"testing"
"go.uber.org/zap"
"github.com/aquasecurity/trivy/pkg/db"
"github.com/aquasecurity/trivy/pkg/git"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/utils"
"github.com/aquasecurity/trivy/pkg/vulnsrc/vulnerability"
)
func BenchmarkUpdate(b *testing.B) {
log.Logger = zap.NewNop().Sugar()
utils.Quiet = true
if err := db.Init(); err != nil {
b.Fatal(err)
}
dir := filepath.Join(utils.CacheDir(), "vuln-list")
if _, err := git.CloneOrPull(repoURL, dir); err != nil {
b.Fatal(err)
}
b.ResetTimer()
b.Run("NVD", func(b *testing.B) {
for i := 0; i < b.N; i++ {
if err := db.SetVersion(""); err != nil {
b.Fatal(err)
}
if err := Update([]string{vulnerability.Nvd}); err != nil {
b.Fatal(err)
}
}
})
}