mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-18 10:19:27 -08:00
Compare commits
4 Commits
release/v0
...
release/v0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
854c61d34a | ||
|
|
334a1c293b | ||
|
|
f61725c28b | ||
|
|
a7b7117fe2 |
@@ -1 +1 @@
|
|||||||
{".":"0.54.0"}
|
{".":"0.54.1"}
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.54.1](https://github.com/aquasecurity/trivy/compare/v0.54.0...v0.54.1) (2024-07-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **flag:** incorrect behavior for deprected flag `--clear-cache` [backport: release/v0.54] ([#7285](https://github.com/aquasecurity/trivy/issues/7285)) ([334a1c2](https://github.com/aquasecurity/trivy/commit/334a1c293bb3d490af2a6d80732f399efaac22f7))
|
||||||
|
* **java:** Return error when trying to find a remote pom to avoid segfault [backport: release/v0.54] ([#7283](https://github.com/aquasecurity/trivy/issues/7283)) ([f61725c](https://github.com/aquasecurity/trivy/commit/f61725c28b56d80fb46395479842a2ab0c517c5f))
|
||||||
|
* **plugin:** do not call GitHub content API for releases and tags [backport: release/v0.54] ([#7279](https://github.com/aquasecurity/trivy/issues/7279)) ([a7b7117](https://github.com/aquasecurity/trivy/commit/a7b7117fe2c9608e990b42e702cc83675c48f888))
|
||||||
|
|
||||||
## [0.54.0](https://github.com/aquasecurity/trivy/compare/v0.53.0...v0.54.0) (2024-07-30)
|
## [0.54.0](https://github.com/aquasecurity/trivy/compare/v0.53.0...v0.54.0) (2024-07-30)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
multierror "github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
"golang.org/x/net/html/charset"
|
"golang.org/x/net/html/charset"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
@@ -680,18 +680,15 @@ func (p *Parser) fetchPOMFromRemoteRepositories(paths []string, snapshot bool) (
|
|||||||
func (p *Parser) remoteRepoRequest(repo string, paths []string) (*http.Request, error) {
|
func (p *Parser) remoteRepoRequest(repo string, paths []string) (*http.Request, error) {
|
||||||
repoURL, err := url.Parse(repo)
|
repoURL, err := url.Parse(repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.logger.Error("URL parse error", log.String("repo", repo))
|
return nil, xerrors.Errorf("unable to parse URL: %w", err)
|
||||||
return nil, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paths = append([]string{repoURL.Path}, paths...)
|
paths = append([]string{repoURL.Path}, paths...)
|
||||||
repoURL.Path = path.Join(paths...)
|
repoURL.Path = path.Join(paths...)
|
||||||
|
|
||||||
logger := p.logger.With(log.String("host", repoURL.Host), log.String("path", repoURL.Path))
|
|
||||||
req, err := http.NewRequest("GET", repoURL.String(), http.NoBody)
|
req, err := http.NewRequest("GET", repoURL.String(), http.NoBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Debug("HTTP request failed")
|
return nil, xerrors.Errorf("unable to create HTTP request: %w", err)
|
||||||
return nil, nil
|
|
||||||
}
|
}
|
||||||
if repoURL.User != nil {
|
if repoURL.User != nil {
|
||||||
password, _ := repoURL.User.Password()
|
password, _ := repoURL.User.Password()
|
||||||
@@ -709,7 +706,8 @@ func (p *Parser) fetchPomFileNameFromMavenMetadata(repo string, paths []string)
|
|||||||
|
|
||||||
req, err := p.remoteRepoRequest(repo, mavenMetadataPaths)
|
req, err := p.remoteRepoRequest(repo, mavenMetadataPaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", xerrors.Errorf("unable to create request for maven-metadata.xml file")
|
p.logger.Debug("Unable to create request", log.String("repo", repo), log.Err(err))
|
||||||
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
@@ -739,7 +737,8 @@ func (p *Parser) fetchPomFileNameFromMavenMetadata(repo string, paths []string)
|
|||||||
func (p *Parser) fetchPOMFromRemoteRepository(repo string, paths []string) (*pom, error) {
|
func (p *Parser) fetchPOMFromRemoteRepository(repo string, paths []string) (*pom, error) {
|
||||||
req, err := p.remoteRepoRequest(repo, paths)
|
req, err := p.remoteRepoRequest(repo, paths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, xerrors.Errorf("unable to create request for pom file")
|
p.logger.Debug("Unable to create request", log.String("repo", repo), log.Err(err))
|
||||||
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
|
|||||||
@@ -154,7 +154,8 @@ func (t *CustomTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
|||||||
func NewGitHubTransport(u *url.URL, insecure bool, token string) http.RoundTripper {
|
func NewGitHubTransport(u *url.URL, insecure bool, token string) http.RoundTripper {
|
||||||
client := newGitHubClient(insecure, token)
|
client := newGitHubClient(insecure, token)
|
||||||
ss := strings.SplitN(u.Path, "/", 4)
|
ss := strings.SplitN(u.Path, "/", 4)
|
||||||
if len(ss) < 4 || strings.HasPrefix(ss[3], "archive/") {
|
if len(ss) < 4 || strings.HasPrefix(ss[3], "archive/") || strings.HasPrefix(ss[3], "releases/") ||
|
||||||
|
strings.HasPrefix(ss[3], "tags/") {
|
||||||
// Use the default transport from go-github for authentication
|
// Use the default transport from go-github for authentication
|
||||||
return client.Client().Transport
|
return client.Client().Transport
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ type CacheOptions struct {
|
|||||||
// NewCacheFlagGroup returns a default CacheFlagGroup
|
// NewCacheFlagGroup returns a default CacheFlagGroup
|
||||||
func NewCacheFlagGroup() *CacheFlagGroup {
|
func NewCacheFlagGroup() *CacheFlagGroup {
|
||||||
return &CacheFlagGroup{
|
return &CacheFlagGroup{
|
||||||
|
ClearCache: ClearCacheFlag.Clone(),
|
||||||
CacheBackend: CacheBackendFlag.Clone(),
|
CacheBackend: CacheBackendFlag.Clone(),
|
||||||
CacheTTL: CacheTTLFlag.Clone(),
|
CacheTTL: CacheTTLFlag.Clone(),
|
||||||
RedisTLS: RedisTLSFlag.Clone(),
|
RedisTLS: RedisTLSFlag.Clone(),
|
||||||
|
|||||||
Reference in New Issue
Block a user