Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(misconf): Update trivy-checks default repo to mirror.gcr.io #7953

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

simar7
Copy link
Member

@simar7 simar7 commented Nov 19, 2024

Description

Merge once trivy-checks is available on DockerHub.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@simar7 simar7 requested a review from nikpivkin November 19, 2024 07:23
pkg/policy/policy.go Outdated Show resolved Hide resolved
@nikpivkin
Copy link
Contributor

trivy-cheks is available on Docker Hub

trivy conf main.tf -d --checks-bundle-repository mirror.gcr.io/aquasec/trivy-checks:latest
2024-11-19T14:03:27+06:00       DEBUG   Default config file "file_path=trivy.yaml" not found, using built in values
2024-11-19T14:03:27+06:00       DEBUG   Cache dir       dir="/Users/nikita/Library/Caches/trivy"
2024-11-19T14:03:27+06:00       DEBUG   Cache dir       dir="/Users/nikita/Library/Caches/trivy"
2024-11-19T14:03:27+06:00       DEBUG   Parsed severities       severities=[UNKNOWN LOW MEDIUM HIGH CRITICAL]
2024-11-19T14:03:27+06:00       INFO    [misconfig] Misconfiguration scanning is enabled
2024-11-19T14:03:27+06:00       DEBUG   [misconfig] Failed to open the check metadata   err="open /Users/nikita/Library/Caches/trivy/policy/metadata.json: no such file or directory"
2024-11-19T14:03:27+06:00       INFO    [misconfig] Need to update the built-in checks
2024-11-19T14:03:27+06:00       INFO    [misconfig] Downloading the built-in checks...
2024-11-19T14:03:27+06:00       DEBUG   [misconfig] Loading check bundle        repository="mirror.gcr.io/aquasec/trivy-checks:latest"
201.91 KiB / 201.91 KiB [------------------------------------------------------] 100.00% 2.47 MiB p/s 300ms
2024-11-19T14:03:29+06:00       DEBUG   [misconfig] Digest of the built-in checks       digest="sha256:adcb0056766fa124695e6d538304b6d4bbf9409eafbc0b6e1f3a8b7439f999c6"
2024-11-19T14:03:29+06:00       DEBUG   [misconfig] Checks successfully loaded from disk

@simar7 simar7 marked this pull request as ready for review November 19, 2024 23:36
@simar7 simar7 requested a review from knqyf263 as a code owner November 19, 2024 23:36
@simar7 simar7 requested a review from nikpivkin November 19, 2024 23:36
@@ -19,7 +19,7 @@ import (

const (
BundleVersion = 1 // Latest released MAJOR version for trivy-checks
BundleRepository = "ghcr.io/aquasecurity/trivy-checks"
BundleRepository = "mirror.gcr.io/aquasec/trivy-checks"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We also use GHCR as a secondary for other databases. Just in case mirror.gcr.io is down, Trivy falls back into GHCR.

Copy link

@anantM001 anantM001 Nov 20, 2024

Choose a reason for hiding this comment

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

Apart from that, I think that the --checks-bundle-repository flag should also provide fallback functionality just like the --db-repository flag. Right now we can only specify a single checks repository with this option, it would we great if multiple checks repo can be specified using this option so that if one repo fails second one can be used as a fallback.

Copy link
Contributor

Choose a reason for hiding this comment

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

We're discussing it.

Choose a reason for hiding this comment

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

Thanks

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we should. Track #7960

Choose a reason for hiding this comment

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

Thanks

Copy link
Contributor

@nikpivkin nikpivkin left a comment

Choose a reason for hiding this comment

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

LGTM

@simar7 simar7 changed the title feat: Update trivy-checks default repo to mirror.gcr.io fix(misconf): Update trivy-checks default repo to mirror.gcr.io Nov 20, 2024
@simar7 simar7 added this pull request to the merge queue Nov 20, 2024
Merged via the queue into aquasecurity:main with commit 9988147 Nov 20, 2024
20 checks passed
@simar7 simar7 deleted the update-checks-repo branch November 20, 2024 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants