Skip to content

Conversation

@knqyf263
Copy link
Collaborator

@knqyf263 knqyf263 commented Apr 15, 2020

trivy --version shows the database metadata, but we need to avoid opening the database because BoltDB can't be opened by two processes at the same time. So, this PR introduces metadata.json which contains the database metadata such as schema version and next updated at. This file is stored after downloading the database successfully. Also, this file is removed before downloading the database. It means the database file is incomplete if there is not metadata.json in a local file system. trivy --version can use this file instead of opening DB.

@knqyf263 knqyf263 added the kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. label Apr 15, 2020
@knqyf263 knqyf263 self-assigned this Apr 15, 2020
@knqyf263 knqyf263 requested a review from danielpacak April 15, 2020 08:55
Copy link
Contributor

@danielpacak danielpacak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Also run it on my local and it works as expected

@knqyf263 knqyf263 merged commit ac5f313 into master Apr 15, 2020
@knqyf263 knqyf263 deleted the metadata_file branch April 15, 2020 13:07
GuaoGuao pushed a commit to GuaoGuao/trivy that referenced this pull request Jun 24, 2020
* refactor: wrap errors

* feat(db): add the metadata file

* test(db): re-generate mocks

* fix(app): read metadata from the file in showVersion

* fix: open the database after downloading it

* fix(operation): use UpdateMetadata

* chore(mod): update dependency

* test(integration): fix tests

* fix(conf): rename TRIVY_NONSSL to TRIVY_NON_SSL
liamg pushed a commit that referenced this pull request Jun 7, 2022
* refactor: wrap errors

* feat(db): add the metadata file

* test(db): re-generate mocks

* fix(app): read metadata from the file in showVersion

* fix: open the database after downloading it

* fix(operation): use UpdateMetadata

* chore(mod): update dependency

* test(integration): fix tests

* fix(conf): rename TRIVY_NONSSL to TRIVY_NON_SSL
josedonizetti pushed a commit to josedonizetti/trivy that referenced this pull request Jun 24, 2022
…rity#493)

* feat(check): Add separate check for SNS encryption with CMK

Resolves aquasecurity#464

Signed-off-by: Liam Galvin <[email protected]>

* docs: add missing docs

* docs: add missing docs
black-leg-nameko pushed a commit to black-leg-nameko/trivy that referenced this pull request Sep 16, 2025
* fix(gcp): properly check if bucket has logging

Signed-off-by: Nikita Pivkin <[email protected]>

* chore: require Trivy >= 0.66.0 for GCP-0077

Signed-off-by: Nikita Pivkin <[email protected]>

---------

Signed-off-by: Nikita Pivkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants