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

Bump trivy to v0.54.1 and fix breaking changes #2399

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

romulets
Copy link
Member

@romulets romulets commented Aug 7, 2024

Summary of your changes

Related Issues

@romulets romulets requested a review from a team as a code owner August 7, 2024 14:12
Copy link

mergify bot commented Aug 7, 2024

This pull request does not have a backport label. Could you fix it @romulets? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit
    NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip label Aug 7, 2024
xlog.SetLogger(scanLog)
tlog.Logger = scanLog
tlog.SetDefault(slog.New(zapslog.NewHandler(log.Core(), nil)))
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix breaking change introduced by zap replacement by slog (aquasecurity/trivy#6466)
I find it weird that trivy uses the default logger for everything. But that's why I used SetDefault from github.com/aquasecurity/trivy/pkg/log, which overrides slog default logger

Comment on lines 52 to 53
PackageOptions: flag.PackageOptions{
PkgTypes: []string{trivy_types.PkgTypeOS, trivy_types.PkgTypeLibrary},
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix breaking change introduced by renaming vuln flags by pckg flags (aquasecurity/trivy#7104)

Comment on lines 120 to 121
PackageOptions: flag.PackageOptions{
PkgTypes: []string{trivy_types.PkgTypeOS, trivy_types.PkgTypeLibrary},
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix breaking change introduced by renaming vuln flags by pckg flags (aquasecurity/trivy#7104)

Comment on lines +61 to +62
DBRepository: name.MustParseReference("ghcr.io/aquasecurity/trivy-db"),
JavaDBRepository: name.MustParseReference("ghcr.io/aquasecurity/trivy-java-db"),
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix breaking change introduced by adoption of name.Reference on DBRepositories (aquasecurity/trivy#6410)

Copy link

github-actions bot commented Aug 7, 2024

📊 Allure Report - 💚 No failures were reported.

Result Count
🟥 Failed 0
🟩 Passed 331
⬜ Skipped 34

Package relationship has been introduced on aquasecurity/trivy#7237 and using CLI there are default relationship values (all). Using the library directly there is no default value and having 0 relationships and retrieving 0 finginds. Therefore on this commit we added the default value with all relationships
VulnType: []string{trivy_types.VulnTypeOS, trivy_types.VulnTypeLibrary},
PackageOptions: flag.PackageOptions{
PkgTypes: []string{trivy_types.PkgTypeOS, trivy_types.PkgTypeLibrary},
PkgRelationships: ftypes.Relationships,
Copy link
Member Author

Choose a reason for hiding this comment

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

Package relationship has been introduced on aquasecurity/trivy#7237 and using CLI there are default relationship values (all). Using the library directly there is no default value and having 0 relationships and retrieving 0 finginds. Therefore on this commit we added the default value with all relationships

VulnType: []string{trivy_types.VulnTypeOS, trivy_types.VulnTypeLibrary},
PackageOptions: flag.PackageOptions{
PkgTypes: []string{trivy_types.PkgTypeOS, trivy_types.PkgTypeLibrary},
PkgRelationships: ftypes.Relationships,
Copy link
Member Author

Choose a reason for hiding this comment

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

Package relationship has been introduced on aquasecurity/trivy#7237 and using CLI there are default relationship values (all). Using the library directly there is no default value and having 0 relationships and retrieving 0 finginds. Therefore on this commit we added the default value with all relationships

@romulets romulets enabled auto-merge (squash) August 9, 2024 14:01
@romulets romulets merged commit dab2d95 into elastic:main Aug 9, 2024
22 checks passed
romulets added a commit that referenced this pull request Aug 12, 2024
oren-zohar pushed a commit that referenced this pull request Aug 12, 2024
Revert "Bump trivy to v0.54.1 and fix breaking changes (#2399)"

This reverts commit dab2d95.
@romulets romulets deleted the bump-trivy branch August 14, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants