From 6fdb554a0d213d20b33c8e379fae0208b9ef8f73 Mon Sep 17 00:00:00 2001 From: Teppei Fukuda Date: Thu, 14 Apr 2022 09:52:51 +0300 Subject: [PATCH] feat(alpine): support apk repositories (#1987) --- docs/docs/vulnerability/detection/os.md | 34 +-- go.mod | 2 +- go.sum | 4 +- integration/client_server_test.go | 7 + integration/standalone_tar_test.go | 8 + .../testdata/alpine-distroless.json.golden | 85 +++++++ integration/testdata/fixtures/db/alpine.yaml | 9 +- .../testdata/fixtures/db/vulnerability.yaml | 18 ++ pkg/detector/ospkg/alma/alma.go | 2 +- pkg/detector/ospkg/alma/alma_test.go | 2 +- pkg/detector/ospkg/alpine/alpine.go | 28 ++- pkg/detector/ospkg/alpine/alpine_test.go | 39 ++- pkg/detector/ospkg/amazon/amazon.go | 2 +- pkg/detector/ospkg/amazon/amazon_test.go | 2 +- pkg/detector/ospkg/debian/debian.go | 2 +- pkg/detector/ospkg/debian/debian_test.go | 2 +- pkg/detector/ospkg/detect.go | 6 +- pkg/detector/ospkg/mariner/mariner.go | 2 +- pkg/detector/ospkg/mariner/mariner_test.go | 2 +- pkg/detector/ospkg/oracle/oracle.go | 2 +- pkg/detector/ospkg/oracle/oracle_test.go | 2 +- pkg/detector/ospkg/photon/photon.go | 2 +- pkg/detector/ospkg/photon/photon_test.go | 2 +- pkg/detector/ospkg/redhat/redhat.go | 2 +- pkg/detector/ospkg/redhat/redhat_test.go | 2 +- pkg/detector/ospkg/rocky/rocky.go | 2 +- pkg/detector/ospkg/rocky/rocky_test.go | 2 +- pkg/detector/ospkg/suse/suse.go | 2 +- pkg/detector/ospkg/suse/suse_test.go | 2 +- pkg/detector/ospkg/ubuntu/ubuntu.go | 2 +- pkg/detector/ospkg/ubuntu/ubuntu_test.go | 2 +- pkg/rpc/convert.go | 24 ++ pkg/scanner/local/mock_ospkg_detector.go | 35 ++- pkg/scanner/local/scan.go | 20 +- rpc/cache/service.pb.go | 212 ++++++++-------- rpc/cache/service.proto | 5 +- rpc/cache/service.twirp.go | 101 ++++---- rpc/common/service.pb.go | 232 ++++++++++++------ rpc/common/service.proto | 7 +- 39 files changed, 618 insertions(+), 298 deletions(-) create mode 100644 integration/testdata/alpine-distroless.json.golden diff --git a/docs/docs/vulnerability/detection/os.md b/docs/docs/vulnerability/detection/os.md index 15bc076ef923..cfc00b395375 100644 --- a/docs/docs/vulnerability/detection/os.md +++ b/docs/docs/vulnerability/detection/os.md @@ -2,23 +2,23 @@ The unfixed/unfixable vulnerabilities mean that the patch has not yet been provided on their distribution. Trivy doesn't support self-compiled packages/binaries, but official packages provided by vendors such as Red Hat and Debian. -| OS | Supported Versions | Target Packages | Detection of unfixed vulnerabilities | -| -------------------------------- | ---------------------------------------- | ----------------------------- | :----------------------------------: | -| Alpine Linux | 2.2 - 2.7, 3.0 - 3.15 | Installed by apk | NO | -| Red Hat Universal Base Image[^1] | 7, 8 | Installed by yum/rpm | YES | -| Red Hat Enterprise Linux | 6, 7, 8 | Installed by yum/rpm | YES | -| CentOS | 6, 7, 8 | Installed by yum/rpm | YES | -| AlmaLinux | 8 | Installed by yum/rpm | NO | -| Rocky Linux | 8 | Installed by yum/rpm | NO | -| Oracle Linux | 5, 6, 7, 8 | Installed by yum/rpm | NO | -| CBL-Mariner | 1.0, 2.0 | Installed by yum/rpm | YES | -| Amazon Linux | 1, 2 | Installed by yum/rpm | NO | -| openSUSE Leap | 42, 15 | Installed by zypper/rpm | NO | -| SUSE Enterprise Linux | 11, 12, 15 | Installed by zypper/rpm | NO | -| Photon OS | 1.0, 2.0, 3.0, 4.0 | Installed by tdnf/yum/rpm | NO | -| Debian GNU/Linux | wheezy, jessie, stretch, buster, bullseye| Installed by apt/apt-get/dpkg | YES | -| Ubuntu | All versions supported by Canonical | Installed by apt/apt-get/dpkg | YES | -| Distroless[^2] | Any | Installed by apt/apt-get/dpkg | YES | +| OS | Supported Versions | Target Packages | Detection of unfixed vulnerabilities | +| -------------------------------- |-------------------------------------------| ----------------------------- | :----------------------------------: | +| Alpine Linux | 2.2 - 2.7, 3.0 - 3.15, edge | Installed by apk | NO | +| Red Hat Universal Base Image[^1] | 7, 8 | Installed by yum/rpm | YES | +| Red Hat Enterprise Linux | 6, 7, 8 | Installed by yum/rpm | YES | +| CentOS | 6, 7, 8 | Installed by yum/rpm | YES | +| AlmaLinux | 8 | Installed by yum/rpm | NO | +| Rocky Linux | 8 | Installed by yum/rpm | NO | +| Oracle Linux | 5, 6, 7, 8 | Installed by yum/rpm | NO | +| CBL-Mariner | 1.0, 2.0 | Installed by yum/rpm | YES | +| Amazon Linux | 1, 2 | Installed by yum/rpm | NO | +| openSUSE Leap | 42, 15 | Installed by zypper/rpm | NO | +| SUSE Enterprise Linux | 11, 12, 15 | Installed by zypper/rpm | NO | +| Photon OS | 1.0, 2.0, 3.0, 4.0 | Installed by tdnf/yum/rpm | NO | +| Debian GNU/Linux | wheezy, jessie, stretch, buster, bullseye | Installed by apt/apt-get/dpkg | YES | +| Ubuntu | All versions supported by Canonical | Installed by apt/apt-get/dpkg | YES | +| Distroless[^2] | Any | Installed by apt/apt-get/dpkg | YES | [^1]: https://developers.redhat.com/products/rhel/ubi [^2]: https://github.com/GoogleContainerTools/distroless diff --git a/go.mod b/go.mod index 581d02d52f37..698ca9a72d16 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Masterminds/sprig/v3 v3.2.2 github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986 - github.com/aquasecurity/fanal v0.0.0-20220413103552-a2db5fcf54ed + github.com/aquasecurity/fanal v0.0.0-20220413153130-ae71d24c572b github.com/aquasecurity/go-dep-parser v0.0.0-20220412145205-d0501f906d90 github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798 diff --git a/go.sum b/go.sum index 8c76cc03b6af..0f0c923338bf 100644 --- a/go.sum +++ b/go.sum @@ -237,8 +237,8 @@ github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986 h1:2a30 github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986/go.mod h1:NT+jyeCzXk6vXR5MTkdn4z64TgGfE5HMLC8qfj5unl8= github.com/aquasecurity/defsec v0.28.4 h1:O0ukf2uMEqRRX3EHfu+9J0EyD39v50NDjwtf96nES8E= github.com/aquasecurity/defsec v0.28.4/go.mod h1:vUdThwusBM7y1gJ7CVX3+h3bsPvpmOIEp3NEdzTDkhA= -github.com/aquasecurity/fanal v0.0.0-20220413103552-a2db5fcf54ed h1:8eCdv9koYS04ib1jVfyYGcUjkn9DcEF+W1WAigZmd4s= -github.com/aquasecurity/fanal v0.0.0-20220413103552-a2db5fcf54ed/go.mod h1:P+PBmaNRkj5kBiRSM5vKtKviKxEm3kK179Mu9BVx1AQ= +github.com/aquasecurity/fanal v0.0.0-20220413153130-ae71d24c572b h1:T4jWSwpQ6Ll1cEHOLiLfvk2bsc3T2meUujct43suSEo= +github.com/aquasecurity/fanal v0.0.0-20220413153130-ae71d24c572b/go.mod h1:7VRXBnhuTlJBjb0ZSQxKrVi+eSpNHnXb2hbfjEG7opw= github.com/aquasecurity/go-dep-parser v0.0.0-20220412145205-d0501f906d90 h1:uZcI5qV7J1pzOc6W49l7iEey/KtEVlaqsNU5l65vZLk= github.com/aquasecurity/go-dep-parser v0.0.0-20220412145205-d0501f906d90/go.mod h1:rK/5BoRt8/D7xXydoVVeBaQuk6zDJ6W+FWz/RqFuJxI= github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce h1:QgBRgJvtEOBtUXilDb1MLi1p1MWoyFDXAu5DEUl5nwM= diff --git a/integration/client_server_test.go b/integration/client_server_test.go index 4a6422759754..ae35a883a7bc 100644 --- a/integration/client_server_test.go +++ b/integration/client_server_test.go @@ -79,6 +79,13 @@ func TestClientServer(t *testing.T) { }, golden: "testdata/alpine-310.json.golden", }, + { + name: "alpine distroless", + args: csArgs{ + Input: "testdata/fixtures/images/alpine-distroless.tar.gz", + }, + golden: "testdata/alpine-distroless.json.golden", + }, { name: "debian buster/10", args: csArgs{ diff --git a/integration/standalone_tar_test.go b/integration/standalone_tar_test.go index 845a28627f10..927eff30c90a 100644 --- a/integration/standalone_tar_test.go +++ b/integration/standalone_tar_test.go @@ -66,6 +66,14 @@ func TestTar(t *testing.T) { }, golden: "testdata/alpine-310.json.golden", }, + { + name: "alpine distroless", + testArgs: args{ + Format: "json", + Input: "testdata/fixtures/images/alpine-distroless.tar.gz", + }, + golden: "testdata/alpine-distroless.json.golden", + }, { name: "amazon linux 1", testArgs: args{ diff --git a/integration/testdata/alpine-distroless.json.golden b/integration/testdata/alpine-distroless.json.golden new file mode 100644 index 000000000000..8b0671e0c0a7 --- /dev/null +++ b/integration/testdata/alpine-distroless.json.golden @@ -0,0 +1,85 @@ +{ + "SchemaVersion": 2, + "ArtifactName": "testdata/fixtures/images/alpine-distroless.tar.gz", + "ArtifactType": "container_image", + "Metadata": { + "OS": { + "Family": "alpine", + "Name": "edge" + }, + "ImageID": "sha256:22848737c0d272ad5d7c7369d8ca830a62929e63e38edcb22085139a6ae0688d", + "DiffIDs": [ + "sha256:89da7cc836da4b53ab1ceb572576458c005e7e444b8bb79abda196668a2f0c92" + ], + "ImageConfig": { + "architecture": "amd64", + "author": "github.com/chainguard-dev/apko", + "created": "1970-01-01T00:00:00Z", + "history": [ + { + "author": "apko", + "created": "1970-01-01T00:00:00Z", + "created_by": "apko", + "comment": "This is an apko single-layer image" + } + ], + "os": "linux", + "rootfs": { + "type": "layers", + "diff_ids": [ + "sha256:89da7cc836da4b53ab1ceb572576458c005e7e444b8bb79abda196668a2f0c92" + ] + }, + "config": { + "Entrypoint": [ + "/usr/bin/git" + ], + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt" + ], + "User": "65532" + } + } + }, + "Results": [ + { + "Target": "testdata/fixtures/images/alpine-distroless.tar.gz (alpine edge)", + "Class": "os-pkgs", + "Type": "alpine", + "Vulnerabilities": [ + { + "VulnerabilityID": "CVE-2022-24765", + "PkgName": "git", + "InstalledVersion": "2.35.1-r2", + "FixedVersion": "2.35.2-r0", + "Layer": { + "DiffID": "sha256:89da7cc836da4b53ab1ceb572576458c005e7e444b8bb79abda196668a2f0c92" + }, + "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2022-24765", + "Title": "Git for Windows is a fork of Git containing Windows-specific patches. ...", + "Description": "Git for Windows is a fork of Git containing Windows-specific patches.", + "Severity": "MEDIUM", + "CweIDs": [ + "CWE-427" + ], + "References": [ + "http://www.openwall.com/lists/oss-security/2022/04/12/7", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24765", + "https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash", + "https://git-scm.com/docs/git#Documentation/git.txt-codeGITCEILINGDIRECTORIEScode", + "https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2", + "https://ubuntu.com/security/notices/USN-5376-1" + ], + "PublishedDate": "2022-04-12T18:15:00Z", + "LastModifiedDate": "2022-04-12T21:15:00Z" + } + ] + }, + { + "Target": "usr/bin/git-lfs", + "Class": "lang-pkgs", + "Type": "gobinary" + } + ] +} diff --git a/integration/testdata/fixtures/db/alpine.yaml b/integration/testdata/fixtures/db/alpine.yaml index 4d409bcfc685..15e5308012a7 100644 --- a/integration/testdata/fixtures/db/alpine.yaml +++ b/integration/testdata/fixtures/db/alpine.yaml @@ -27,4 +27,11 @@ pairs: - key: CVE-2019-14697 value: - FixedVersion: 1.1.20-r5 \ No newline at end of file + FixedVersion: 1.1.20-r5 +- bucket: alpine edge + pairs: + - bucket: git + pairs: + - key: CVE-2022-24765 + value: + FixedVersion: 2.35.2-r0 \ No newline at end of file diff --git a/integration/testdata/fixtures/db/vulnerability.yaml b/integration/testdata/fixtures/db/vulnerability.yaml index 4a47f3c3b998..d1b5fa74eac9 100644 --- a/integration/testdata/fixtures/db/vulnerability.yaml +++ b/integration/testdata/fixtures/db/vulnerability.yaml @@ -1119,3 +1119,21 @@ Title: Security update for openssl-1_1 VendorSeverity: suse-cvrf: 2.0 + - key: CVE-2022-24765 + value: + Title: "Git for Windows is a fork of Git containing Windows-specific patches. ..." + Description: "Git for Windows is a fork of Git containing Windows-specific patches." + CweIDs: + - CWE-427 + References: + - http://www.openwall.com/lists/oss-security/2022/04/12/7 + - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24765 + - https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash + - https://git-scm.com/docs/git#Documentation/git.txt-codeGITCEILINGDIRECTORIEScode + - https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2 + - https://ubuntu.com/security/notices/USN-5376-1 + Severity: MEDIUM + VendorSeverity: + ubuntu: 2 + LastModifiedDate: 2022-04-12T21:15:00Z + PublishedDate: 2022-04-12T18:15:00Z diff --git a/pkg/detector/ospkg/alma/alma.go b/pkg/detector/ospkg/alma/alma.go index a69023ae44be..22b47ef14061 100644 --- a/pkg/detector/ospkg/alma/alma.go +++ b/pkg/detector/ospkg/alma/alma.go @@ -57,7 +57,7 @@ func NewScanner(opts ...option) *Scanner { } // Detect vulnerabilities in package using AlmaLinux scanner -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting AlmaLinux vulnerabilities...") if strings.Count(osVer, ".") > 0 { osVer = osVer[:strings.Index(osVer, ".")] diff --git a/pkg/detector/ospkg/alma/alma_test.go b/pkg/detector/ospkg/alma/alma_test.go index d3d30a83138a..bbc04b49f1bb 100644 --- a/pkg/detector/ospkg/alma/alma_test.go +++ b/pkg/detector/ospkg/alma/alma_test.go @@ -116,7 +116,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := alma.NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) if tt.wantErr != "" { require.Error(t, err) assert.Contains(t, err.Error(), tt.wantErr) diff --git a/pkg/detector/ospkg/alpine/alpine.go b/pkg/detector/ospkg/alpine/alpine.go index df7d2fb752c6..edbf8d79dc84 100644 --- a/pkg/detector/ospkg/alpine/alpine.go +++ b/pkg/detector/ospkg/alpine/alpine.go @@ -42,6 +42,7 @@ var ( "3.13": time.Date(2022, 11, 1, 23, 59, 59, 0, time.UTC), "3.14": time.Date(2023, 5, 1, 23, 59, 59, 0, time.UTC), "3.15": time.Date(2023, 11, 1, 23, 59, 59, 0, time.UTC), + "edge": time.Date(9999, 1, 1, 0, 0, 0, 0, time.UTC), } ) @@ -79,17 +80,27 @@ func NewScanner(opts ...option) *Scanner { } // Detect vulnerabilities in package using Alpine scanner -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, repo *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting Alpine vulnerabilities...") if strings.Count(osVer, ".") > 1 { osVer = osVer[:strings.LastIndex(osVer, ".")] } + repoRelease := s.repoRelease(repo) + log.Logger.Debugf("alpine: os version: %s", osVer) + log.Logger.Debugf("alpine: package repository: %s", repoRelease) log.Logger.Debugf("alpine: the number of packages: %d", len(pkgs)) + stream := osVer + if repoRelease != "" && osVer != repoRelease { + // Prefer the repository release. Use OS version only when the repository is not detected. + stream = repoRelease + log.Logger.Infof("Use the repository release '%s' for vulnerability detection, instead of OS version '%s'", repoRelease, osVer) + } + var vulns []types.DetectedVulnerability for _, pkg := range pkgs { - advisories, err := s.vs.Get(osVer, pkg.SrcName) + advisories, err := s.vs.Get(stream, pkg.SrcName) if err != nil { return nil, xerrors.Errorf("failed to get alpine advisories: %w", err) } @@ -161,8 +172,19 @@ func (s *Scanner) IsSupportedVersion(osFamily, osVer string) bool { eol, ok := eolDates[osVer] if !ok { log.Logger.Warnf("This OS version is not on the EOL list: %s %s", osFamily, osVer) - return false + return true // may be the latest version } return s.clock.Now().Before(eol) } + +func (s *Scanner) repoRelease(repo *ftypes.Repository) string { + if repo == nil { + return "" + } + release := repo.Release + if strings.Count(release, ".") > 1 { + release = release[:strings.LastIndex(release, ".")] + } + return release +} diff --git a/pkg/detector/ospkg/alpine/alpine_test.go b/pkg/detector/ospkg/alpine/alpine_test.go index 873029a13724..11850a6cd2fd 100644 --- a/pkg/detector/ospkg/alpine/alpine_test.go +++ b/pkg/detector/ospkg/alpine/alpine_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + "github.com/aquasecurity/fanal/analyzer/os" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" fake "k8s.io/utils/clock/testing" @@ -21,6 +23,7 @@ import ( func TestScanner_Detect(t *testing.T) { type args struct { osVer string + repo *ftypes.Repository pkgs []ftypes.Package } tests := []struct { @@ -146,6 +149,38 @@ func TestScanner_Detect(t *testing.T) { }, }, }, + { + name: "repository is newer than OS version", + fixtures: []string{"testdata/fixtures/alpine.yaml", "testdata/fixtures/data-source.yaml"}, + args: args{ + osVer: "3.9.3", + repo: &ftypes.Repository{ + Family: os.Alpine, + Release: "3.10", + }, + pkgs: []ftypes.Package{ + { + Name: "jq", + Version: "1.6-r0", + SrcName: "jq", + SrcVersion: "1.6-r0", + }, + }, + }, + want: []types.DetectedVulnerability{ + { + PkgName: "jq", + VulnerabilityID: "CVE-2020-1234", + InstalledVersion: "1.6-r0", + FixedVersion: "1.6-r1", + DataSource: &dbTypes.DataSource{ + ID: vulnerability.Alpine, + Name: "Alpine Secdb", + URL: "https://secdb.alpinelinux.org/", + }, + }, + }, + }, { name: "Get returns an error", fixtures: []string{"testdata/fixtures/invalid.yaml", "testdata/fixtures/data-source.yaml"}, @@ -169,7 +204,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := alpine.NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, tt.args.repo, tt.args.pkgs) if tt.wantErr != "" { require.Error(t, err) assert.Contains(t, err.Error(), tt.wantErr) @@ -239,7 +274,7 @@ func TestScanner_IsSupportedVersion(t *testing.T) { osFamily: "alpine", osVer: "unknown", }, - want: false, + want: true, }, } for _, tt := range tests { diff --git a/pkg/detector/ospkg/amazon/amazon.go b/pkg/detector/ospkg/amazon/amazon.go index f7c6ced92282..fa660d766f1c 100644 --- a/pkg/detector/ospkg/amazon/amazon.go +++ b/pkg/detector/ospkg/amazon/amazon.go @@ -61,7 +61,7 @@ func NewScanner(opts ...option) *Scanner { } // Detect scans the packages using amazon scanner -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting Amazon Linux vulnerabilities...") osVer = strings.Fields(osVer)[0] diff --git a/pkg/detector/ospkg/amazon/amazon_test.go b/pkg/detector/ospkg/amazon/amazon_test.go index a2c9456b60a9..a344886afefd 100644 --- a/pkg/detector/ospkg/amazon/amazon_test.go +++ b/pkg/detector/ospkg/amazon/amazon_test.go @@ -130,7 +130,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := amazon.NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) if tt.wantErr != "" { require.Error(t, err) assert.Contains(t, err.Error(), tt.wantErr) diff --git a/pkg/detector/ospkg/debian/debian.go b/pkg/detector/ospkg/debian/debian.go index 827b3d9c37c7..ad2587823ac9 100644 --- a/pkg/detector/ospkg/debian/debian.go +++ b/pkg/detector/ospkg/debian/debian.go @@ -74,7 +74,7 @@ func NewScanner(opts ...option) *Scanner { } // Detect scans and return vulnerabilities using Debian scanner -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting Debian vulnerabilities...") if strings.Count(osVer, ".") > 0 { diff --git a/pkg/detector/ospkg/debian/debian_test.go b/pkg/detector/ospkg/debian/debian_test.go index 7fc0d737fe08..ccadf394a80f 100644 --- a/pkg/detector/ospkg/debian/debian_test.go +++ b/pkg/detector/ospkg/debian/debian_test.go @@ -108,7 +108,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := debian.NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) if tt.wantErr != "" { require.Error(t, err) assert.Contains(t, err.Error(), tt.wantErr) diff --git a/pkg/detector/ospkg/detect.go b/pkg/detector/ospkg/detect.go index 82d7dca965cb..a0b467994cce 100644 --- a/pkg/detector/ospkg/detect.go +++ b/pkg/detector/ospkg/detect.go @@ -62,7 +62,7 @@ type Operation interface { // Driver defines operations for OS package scan type Driver interface { - Detect(string, []ftypes.Package) ([]types.DetectedVulnerability, error) + Detect(string, *ftypes.Repository, []ftypes.Package) ([]types.DetectedVulnerability, error) IsSupportedVersion(string, string) bool } @@ -70,7 +70,7 @@ type Driver interface { type Detector struct{} // Detect detects the vulnerabilities -func (d Detector) Detect(_, osFamily, osName string, _ time.Time, pkgs []ftypes.Package) ([]types.DetectedVulnerability, bool, error) { +func (d Detector) Detect(_, osFamily, osName string, repo *ftypes.Repository, _ time.Time, pkgs []ftypes.Package) ([]types.DetectedVulnerability, bool, error) { driver, err := newDriver(osFamily) if err != nil { return nil, false, ErrUnsupportedOS @@ -78,7 +78,7 @@ func (d Detector) Detect(_, osFamily, osName string, _ time.Time, pkgs []ftypes. eosl := !driver.IsSupportedVersion(osFamily, osName) - vulns, err := driver.Detect(osName, pkgs) + vulns, err := driver.Detect(osName, repo, pkgs) if err != nil { return nil, false, xerrors.Errorf("failed detection: %w", err) } diff --git a/pkg/detector/ospkg/mariner/mariner.go b/pkg/detector/ospkg/mariner/mariner.go index bcf08f8894e8..78ca5872541e 100644 --- a/pkg/detector/ospkg/mariner/mariner.go +++ b/pkg/detector/ospkg/mariner/mariner.go @@ -26,7 +26,7 @@ func NewScanner() *Scanner { } // Detect vulnerabilities in package using CBL-Mariner scanner -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting CBL-Mariner vulnerabilities...") // e.g. 1.0.20210127 diff --git a/pkg/detector/ospkg/mariner/mariner_test.go b/pkg/detector/ospkg/mariner/mariner_test.go index 19dc88b0afbf..1598ffffe832 100644 --- a/pkg/detector/ospkg/mariner/mariner_test.go +++ b/pkg/detector/ospkg/mariner/mariner_test.go @@ -134,7 +134,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := mariner.NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) if tt.wantErr != "" { require.Error(t, err) assert.Contains(t, err.Error(), tt.wantErr) diff --git a/pkg/detector/ospkg/oracle/oracle.go b/pkg/detector/ospkg/oracle/oracle.go index 35f5aabe235e..9e2cc9d06fe4 100644 --- a/pkg/detector/ospkg/oracle/oracle.go +++ b/pkg/detector/ospkg/oracle/oracle.go @@ -54,7 +54,7 @@ func extractKsplice(v string) string { } // Detect scans and return vulnerability in Oracle scanner -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting Oracle Linux vulnerabilities...") if strings.Count(osVer, ".") > 0 { diff --git a/pkg/detector/ospkg/oracle/oracle_test.go b/pkg/detector/ospkg/oracle/oracle_test.go index 3802e832bb9d..983e20653b67 100644 --- a/pkg/detector/ospkg/oracle/oracle_test.go +++ b/pkg/detector/ospkg/oracle/oracle_test.go @@ -239,7 +239,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) if tt.wantErr != "" { require.NotNil(t, err) assert.Contains(t, err.Error(), tt.wantErr) diff --git a/pkg/detector/ospkg/photon/photon.go b/pkg/detector/ospkg/photon/photon.go index 6aa29c115508..a368894a73a5 100644 --- a/pkg/detector/ospkg/photon/photon.go +++ b/pkg/detector/ospkg/photon/photon.go @@ -59,7 +59,7 @@ func NewScanner(opts ...option) *Scanner { } // Detect scans and returns vulnerabilities using photon scanner -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting Photon Linux vulnerabilities...") log.Logger.Debugf("Photon Linux: os version: %s", osVer) log.Logger.Debugf("Photon Linux: the number of packages: %d", len(pkgs)) diff --git a/pkg/detector/ospkg/photon/photon_test.go b/pkg/detector/ospkg/photon/photon_test.go index c639c1f5372e..8c1b4b12faa3 100644 --- a/pkg/detector/ospkg/photon/photon_test.go +++ b/pkg/detector/ospkg/photon/photon_test.go @@ -88,7 +88,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := photon.NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) if tt.wantErr != "" { require.Error(t, err) assert.Contains(t, err.Error(), tt.wantErr) diff --git a/pkg/detector/ospkg/redhat/redhat.go b/pkg/detector/ospkg/redhat/redhat.go index 29c8b781a686..982c5d5d37fe 100644 --- a/pkg/detector/ospkg/redhat/redhat.go +++ b/pkg/detector/ospkg/redhat/redhat.go @@ -92,7 +92,7 @@ func NewScanner(opts ...option) *Scanner { } // Detect scans and returns redhat vulenrabilities -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting RHEL/CentOS vulnerabilities...") if strings.Count(osVer, ".") > 0 { osVer = osVer[:strings.Index(osVer, ".")] diff --git a/pkg/detector/ospkg/redhat/redhat_test.go b/pkg/detector/ospkg/redhat/redhat_test.go index 83b0a2c71651..f39ed26e0826 100644 --- a/pkg/detector/ospkg/redhat/redhat_test.go +++ b/pkg/detector/ospkg/redhat/redhat_test.go @@ -274,7 +274,7 @@ func TestScanner_Detect(t *testing.T) { dbtest.InitDB(t, tt.fixtures) s := redhat.NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) require.Equal(t, tt.wantErr, err != nil, err) assert.Equal(t, tt.want, got) }) diff --git a/pkg/detector/ospkg/rocky/rocky.go b/pkg/detector/ospkg/rocky/rocky.go index ba16d0fe18f2..7096f769120c 100644 --- a/pkg/detector/ospkg/rocky/rocky.go +++ b/pkg/detector/ospkg/rocky/rocky.go @@ -57,7 +57,7 @@ func NewScanner(opts ...option) *Scanner { } // Detect vulnerabilities in package using Rocky Linux scanner -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting Rocky Linux vulnerabilities...") if strings.Count(osVer, ".") > 0 { osVer = osVer[:strings.Index(osVer, ".")] diff --git a/pkg/detector/ospkg/rocky/rocky_test.go b/pkg/detector/ospkg/rocky/rocky_test.go index 3ac809041c20..3bc02520607c 100644 --- a/pkg/detector/ospkg/rocky/rocky_test.go +++ b/pkg/detector/ospkg/rocky/rocky_test.go @@ -113,7 +113,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := rocky.NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) if tt.wantErr != "" { require.Error(t, err) assert.Contains(t, err.Error(), tt.wantErr) diff --git a/pkg/detector/ospkg/suse/suse.go b/pkg/detector/ospkg/suse/suse.go index a228d31f763f..5a19214fe904 100644 --- a/pkg/detector/ospkg/suse/suse.go +++ b/pkg/detector/ospkg/suse/suse.go @@ -110,7 +110,7 @@ func NewScanner(t Type, opts ...option) *Scanner { } // Detect scans and returns the vulnerabilities -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { log.Logger.Info("Detecting SUSE vulnerabilities...") log.Logger.Debugf("SUSE: os version: %s", osVer) log.Logger.Debugf("SUSE: the number of packages: %d", len(pkgs)) diff --git a/pkg/detector/ospkg/suse/suse_test.go b/pkg/detector/ospkg/suse/suse_test.go index e139a0d99b09..0b5411dd5c0b 100644 --- a/pkg/detector/ospkg/suse/suse_test.go +++ b/pkg/detector/ospkg/suse/suse_test.go @@ -91,7 +91,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := suse.NewScanner(tt.distribution) - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) if tt.wantErr != "" { require.Error(t, err) assert.Contains(t, err.Error(), tt.wantErr) diff --git a/pkg/detector/ospkg/ubuntu/ubuntu.go b/pkg/detector/ospkg/ubuntu/ubuntu.go index db6418adefe2..ba2339e5301d 100644 --- a/pkg/detector/ospkg/ubuntu/ubuntu.go +++ b/pkg/detector/ospkg/ubuntu/ubuntu.go @@ -88,7 +88,7 @@ func NewScanner(opts ...option) *Scanner { } // Detect scans and returns the vulnerabilities -func (s *Scanner) Detect(osVer string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) { +func (s *Scanner) Detect(osVer string, _ *ftypes.Repository, pkgs []ftypes.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)) diff --git a/pkg/detector/ospkg/ubuntu/ubuntu_test.go b/pkg/detector/ospkg/ubuntu/ubuntu_test.go index 2cc077092bd8..f5097d266fd1 100644 --- a/pkg/detector/ospkg/ubuntu/ubuntu_test.go +++ b/pkg/detector/ospkg/ubuntu/ubuntu_test.go @@ -101,7 +101,7 @@ func TestScanner_Detect(t *testing.T) { defer db.Close() s := ubuntu.NewScanner() - got, err := s.Detect(tt.args.osVer, tt.args.pkgs) + got, err := s.Detect(tt.args.osVer, nil, tt.args.pkgs) if tt.wantErr != "" { require.Error(t, err) assert.Contains(t, err.Error(), tt.wantErr) diff --git a/pkg/rpc/convert.go b/pkg/rpc/convert.go index 8560dd3c70b9..02a1e8c3e80d 100644 --- a/pkg/rpc/convert.go +++ b/pkg/rpc/convert.go @@ -310,6 +310,17 @@ func ConvertFromRPCOS(rpcOS *common.OS) *ftypes.OS { } } +// ConvertFromRPCRepository converts common.Repository to fanal.Repository +func ConvertFromRPCRepository(rpcRepo *common.Repository) *ftypes.Repository { + if rpcRepo == nil { + return nil + } + return &ftypes.Repository{ + Family: rpcRepo.Family, + Release: rpcRepo.Release, + } +} + // ConvertFromRPCDataSource converts *common.DataSource to *dbTypes.DataSource func ConvertFromRPCDataSource(ds *common.DataSource) *dbTypes.DataSource { if ds == nil { @@ -402,6 +413,7 @@ func ConvertFromRPCPutBlobRequest(req *cache.PutBlobRequest) ftypes.BlobInfo { Digest: req.BlobInfo.Digest, DiffID: req.BlobInfo.DiffId, OS: ConvertFromRPCOS(req.BlobInfo.Os), + Repository: ConvertFromRPCRepository(req.BlobInfo.Repository), PackageInfos: ConvertFromRPCPackageInfos(req.BlobInfo.PackageInfos), Applications: ConvertFromRPCApplications(req.BlobInfo.Applications), Misconfigurations: ConvertFromRPCMisconfigurations(req.BlobInfo.Misconfigurations), @@ -423,6 +435,17 @@ func ConvertToRPCOS(fos *ftypes.OS) *common.OS { } } +// ConvertToRPCRepository returns common.Repository +func ConvertToRPCRepository(repo *ftypes.Repository) *common.Repository { + if repo == nil { + return nil + } + return &common.Repository{ + Family: repo.Family, + Release: repo.Release, + } +} + // ConvertToRPCArtifactInfo returns PutArtifactRequest func ConvertToRPCArtifactInfo(imageID string, imageInfo ftypes.ArtifactInfo) *cache.PutArtifactRequest { t, err := ptypes.TimestampProto(imageInfo.Created) @@ -500,6 +523,7 @@ func ConvertToRPCBlobInfo(diffID string, blobInfo ftypes.BlobInfo) *cache.PutBlo Digest: blobInfo.Digest, DiffId: blobInfo.DiffID, Os: ConvertToRPCOS(blobInfo.OS), + Repository: ConvertToRPCRepository(blobInfo.Repository), PackageInfos: packageInfos, Applications: applications, Misconfigurations: misconfigurations, diff --git a/pkg/scanner/local/mock_ospkg_detector.go b/pkg/scanner/local/mock_ospkg_detector.go index abb04edf3ddb..7149e6136159 100644 --- a/pkg/scanner/local/mock_ospkg_detector.go +++ b/pkg/scanner/local/mock_ospkg_detector.go @@ -2,10 +2,14 @@ package local -import mock "github.com/stretchr/testify/mock" -import pkgtypes "github.com/aquasecurity/trivy/pkg/types" -import time "time" -import types "github.com/aquasecurity/fanal/types" +import ( + pkgtypes "github.com/aquasecurity/trivy/pkg/types" + mock "github.com/stretchr/testify/mock" + + time "time" + + types "github.com/aquasecurity/fanal/types" +) // MockOspkgDetector is an autogenerated mock type for the OspkgDetector type type MockOspkgDetector struct { @@ -19,6 +23,8 @@ type OspkgDetectorDetectArgs struct { OsFamilyAnything bool OsName string OsNameAnything bool + Repo *types.Repository + RepoAnything bool Created time.Time CreatedAnything bool Pkgs []types.Package @@ -53,6 +59,11 @@ func (_m *MockOspkgDetector) ApplyDetectExpectation(e OspkgDetectorDetectExpecta } else { args = append(args, e.Args.OsName) } + if e.Args.RepoAnything { + args = append(args, mock.Anything) + } else { + args = append(args, e.Args.Repo) + } if e.Args.CreatedAnything { args = append(args, mock.Anything) } else { @@ -73,12 +84,12 @@ func (_m *MockOspkgDetector) ApplyDetectExpectations(expectations []OspkgDetecto } // Detect provides a mock function with given fields: imageName, osFamily, osName, created, pkgs -func (_m *MockOspkgDetector) Detect(imageName string, osFamily string, osName string, created time.Time, pkgs []types.Package) ([]pkgtypes.DetectedVulnerability, bool, error) { - ret := _m.Called(imageName, osFamily, osName, created, pkgs) +func (_m *MockOspkgDetector) Detect(imageName string, osFamily string, osName string, repo *types.Repository, created time.Time, pkgs []types.Package) ([]pkgtypes.DetectedVulnerability, bool, error) { + ret := _m.Called(imageName, osFamily, osName, repo, created, pkgs) var r0 []pkgtypes.DetectedVulnerability - if rf, ok := ret.Get(0).(func(string, string, string, time.Time, []types.Package) []pkgtypes.DetectedVulnerability); ok { - r0 = rf(imageName, osFamily, osName, created, pkgs) + if rf, ok := ret.Get(0).(func(string, string, string, *types.Repository, time.Time, []types.Package) []pkgtypes.DetectedVulnerability); ok { + r0 = rf(imageName, osFamily, osName, repo, created, pkgs) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]pkgtypes.DetectedVulnerability) @@ -86,15 +97,15 @@ func (_m *MockOspkgDetector) Detect(imageName string, osFamily string, osName st } var r1 bool - if rf, ok := ret.Get(1).(func(string, string, string, time.Time, []types.Package) bool); ok { - r1 = rf(imageName, osFamily, osName, created, pkgs) + if rf, ok := ret.Get(1).(func(string, string, string, *types.Repository, time.Time, []types.Package) bool); ok { + r1 = rf(imageName, osFamily, osName, repo, created, pkgs) } else { r1 = ret.Get(1).(bool) } var r2 error - if rf, ok := ret.Get(2).(func(string, string, string, time.Time, []types.Package) error); ok { - r2 = rf(imageName, osFamily, osName, created, pkgs) + if rf, ok := ret.Get(2).(func(string, string, string, *types.Repository, time.Time, []types.Package) error); ok { + r2 = rf(imageName, osFamily, osName, repo, created, pkgs) } else { r2 = ret.Error(2) } diff --git a/pkg/scanner/local/scan.go b/pkg/scanner/local/scan.go index d7956ab63707..cb3c6f836823 100644 --- a/pkg/scanner/local/scan.go +++ b/pkg/scanner/local/scan.go @@ -49,7 +49,7 @@ type Applier interface { // OspkgDetector defines operation to detect OS vulnerabilities type OspkgDetector interface { - Detect(imageName, osFamily, osName string, created time.Time, pkgs []ftypes.Package) (detectedVulns []types.DetectedVulnerability, eosl bool, err error) + Detect(imageName, osFamily, osName string, repo *ftypes.Repository, created time.Time, pkgs []ftypes.Package) (detectedVulns []types.DetectedVulnerability, eosl bool, err error) } // Scanner implements the OspkgDetector and LibraryDetector @@ -68,7 +68,17 @@ func (s Scanner) Scan(target string, artifactKey string, blobKeys []string, opti artifactDetail, err := s.applier.ApplyLayers(artifactKey, blobKeys) switch { case errors.Is(err, analyzer.ErrUnknownOS): - log.Logger.Debug("OS is not detected and vulnerabilities in OS packages are not detected.") + log.Logger.Debug("OS is not detected.") + + // If OS is not detected and repositories are detected, we'll try to use repositories as OS. + if artifactDetail.Repository != nil { + log.Logger.Debugf("Package repository: %s %s", artifactDetail.Repository.Family, artifactDetail.Repository.Release) + log.Logger.Debugf("Assuming OS is %s %s.", artifactDetail.Repository.Family, artifactDetail.Repository.Release) + artifactDetail.OS = &ftypes.OS{ + Family: artifactDetail.Repository.Family, + Name: artifactDetail.Repository.Release, + } + } case errors.Is(err, analyzer.ErrNoPkgsDetected): log.Logger.Warn("No OS package is detected. Make sure you haven't deleted any files that contain information about the installed packages.") log.Logger.Warn(`e.g. files under "/lib/apk/db/", "/var/lib/dpkg/" and "/var/lib/rpm"`) @@ -140,7 +150,7 @@ func (s Scanner) scanOSPkgs(target string, detail ftypes.ArtifactDetail, options pkgs = mergePkgs(pkgs, detail.HistoryPackages) } - result, eosl, err := s.detectVulnsInOSPkgs(target, detail.OS.Family, detail.OS.Name, pkgs) + result, eosl, err := s.detectVulnsInOSPkgs(target, detail.OS.Family, detail.OS.Name, detail.Repository, pkgs) if err != nil { return nil, false, xerrors.Errorf("failed to scan OS packages: %w", err) } else if result == nil { @@ -157,11 +167,11 @@ func (s Scanner) scanOSPkgs(target string, detail ftypes.ArtifactDetail, options return result, eosl, nil } -func (s Scanner) detectVulnsInOSPkgs(target, osFamily, osName string, pkgs []ftypes.Package) (*types.Result, bool, error) { +func (s Scanner) detectVulnsInOSPkgs(target, osFamily, osName string, repo *ftypes.Repository, pkgs []ftypes.Package) (*types.Result, bool, error) { if osFamily == "" { return nil, false, nil } - vulns, eosl, err := s.ospkgDetector.Detect("", osFamily, osName, time.Time{}, pkgs) + vulns, eosl, err := s.ospkgDetector.Detect("", osFamily, osName, repo, time.Time{}, pkgs) if err == ospkgDetector.ErrUnsupportedOS { return nil, false, nil } else if err != nil { diff --git a/rpc/cache/service.pb.go b/rpc/cache/service.pb.go index 9572deb20e4c..3f32942db1a2 100644 --- a/rpc/cache/service.pb.go +++ b/rpc/cache/service.pb.go @@ -172,6 +172,7 @@ type BlobInfo struct { SchemaVersion int32 `protobuf:"varint,1,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"` Os *common.OS `protobuf:"bytes,2,opt,name=os,proto3" json:"os,omitempty"` + Repository *common.Repository `protobuf:"bytes,11,opt,name=repository,proto3" json:"repository,omitempty"` PackageInfos []*common.PackageInfo `protobuf:"bytes,3,rep,name=package_infos,json=packageInfos,proto3" json:"package_infos,omitempty"` Applications []*common.Application `protobuf:"bytes,4,rep,name=applications,proto3" json:"applications,omitempty"` Misconfigurations []*common.Misconfiguration `protobuf:"bytes,9,rep,name=misconfigurations,proto3" json:"misconfigurations,omitempty"` @@ -228,6 +229,13 @@ func (x *BlobInfo) GetOs() *common.OS { return nil } +func (x *BlobInfo) GetRepository() *common.Repository { + if x != nil { + return x.Repository + } + return nil +} + func (x *BlobInfo) GetPackageInfos() []*common.PackageInfo { if x != nil { return x.PackageInfos @@ -586,86 +594,90 @@ var file_rpc_cache_service_proto_rawDesc = []byte{ 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, - 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xe2, 0x03, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x49, + 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x9c, 0x04, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4f, 0x53, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x3e, 0x0a, 0x0d, - 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, - 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x3d, 0x0a, 0x0c, - 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x11, 0x6d, - 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x6d, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x61, - 0x71, 0x75, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, - 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x44, 0x69, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x68, - 0x69, 0x74, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0d, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6f, 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x69, 0x66, - 0x66, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x66, 0x66, - 0x49, 0x64, 0x12, 0x47, 0x0a, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, - 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x60, 0x0a, 0x0e, 0x50, - 0x75, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, - 0x07, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x64, 0x69, 0x66, 0x66, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x72, 0x69, 0x76, - 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x43, 0x0a, - 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x02, - 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4f, 0x53, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x12, - 0x0a, 0x04, 0x65, 0x6f, 0x73, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x65, 0x6f, - 0x73, 0x6c, 0x22, 0x51, 0x0a, 0x13, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, - 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x72, 0x74, - 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, - 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, - 0x6f, 0x62, 0x49, 0x64, 0x73, 0x22, 0x6b, 0x0a, 0x14, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, - 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, - 0x10, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, - 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x62, 0x49, - 0x64, 0x73, 0x22, 0x2f, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x62, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x62, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x62, - 0x49, 0x64, 0x73, 0x32, 0xbb, 0x02, 0x0a, 0x05, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x49, 0x0a, - 0x0b, 0x50, 0x75, 0x74, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, 0x22, 0x2e, 0x74, - 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, - 0x74, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x41, 0x0a, 0x07, 0x50, 0x75, 0x74, 0x42, - 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4f, 0x53, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x38, 0x0a, 0x0a, + 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x3e, 0x0a, 0x0d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x3d, 0x0a, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, + 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x11, 0x6d, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x4d, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x11, 0x6d, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x64, 0x69, + 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, + 0x44, 0x69, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6f, 0x75, 0x74, + 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x77, 0x68, + 0x69, 0x74, 0x65, 0x6f, 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x69, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x66, 0x66, 0x49, 0x64, 0x12, 0x47, 0x0a, 0x10, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x60, 0x0a, 0x0e, 0x50, 0x75, 0x74, 0x42, 0x6c, 0x6f, 0x62, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x69, 0x66, 0x66, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x66, 0x66, 0x49, 0x64, + 0x12, 0x35, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x62, + 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x43, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4f, 0x53, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x6f, 0x73, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x65, 0x6f, 0x73, 0x6c, 0x22, 0x51, 0x0a, 0x13, + 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, + 0x63, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x73, 0x22, + 0x6b, 0x0a, 0x14, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6e, 0x67, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, + 0x63, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6c, + 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x73, 0x22, 0x2f, 0x0a, 0x12, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x73, 0x32, 0xbb, 0x02, + 0x0a, 0x05, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x49, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x41, 0x72, + 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, 0x22, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, + 0x61, 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x74, 0x41, 0x72, 0x74, 0x69, 0x66, + 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x12, 0x41, 0x0a, 0x07, 0x50, 0x75, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x2e, + 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x75, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x59, 0x0a, 0x0c, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x23, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, + 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x42, 0x6c, + 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x74, 0x72, 0x69, + 0x76, 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x73, 0x73, + 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x49, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, + 0x22, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x59, 0x0a, 0x0c, 0x4d, - 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x23, 0x2e, 0x74, 0x72, - 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x73, - 0x73, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x24, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x22, 0x2e, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2e, 0x63, 0x61, - 0x63, 0x68, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, - 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x61, 0x71, 0x75, 0x61, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x74, 0x72, 0x69, - 0x76, 0x79, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x3b, 0x63, 0x61, 0x63, - 0x68, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x2f, 0x5a, 0x2d, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x71, 0x75, 0x61, 0x73, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x74, 0x72, 0x69, 0x76, 0x79, 0x2f, 0x72, 0x70, 0x63, + 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x3b, 0x63, 0x61, 0x63, 0x68, 0x65, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -693,36 +705,38 @@ var file_rpc_cache_service_proto_goTypes = []interface{}{ (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp (*common.Package)(nil), // 9: trivy.common.Package (*common.OS)(nil), // 10: trivy.common.OS - (*common.PackageInfo)(nil), // 11: trivy.common.PackageInfo - (*common.Application)(nil), // 12: trivy.common.Application - (*common.Misconfiguration)(nil), // 13: trivy.common.Misconfiguration - (*common.CustomResource)(nil), // 14: trivy.common.CustomResource - (*emptypb.Empty)(nil), // 15: google.protobuf.Empty + (*common.Repository)(nil), // 11: trivy.common.Repository + (*common.PackageInfo)(nil), // 12: trivy.common.PackageInfo + (*common.Application)(nil), // 13: trivy.common.Application + (*common.Misconfiguration)(nil), // 14: trivy.common.Misconfiguration + (*common.CustomResource)(nil), // 15: trivy.common.CustomResource + (*emptypb.Empty)(nil), // 16: google.protobuf.Empty } var file_rpc_cache_service_proto_depIdxs = []int32{ 8, // 0: trivy.cache.v1.ArtifactInfo.created:type_name -> google.protobuf.Timestamp 9, // 1: trivy.cache.v1.ArtifactInfo.history_packages:type_name -> trivy.common.Package 0, // 2: trivy.cache.v1.PutArtifactRequest.artifact_info:type_name -> trivy.cache.v1.ArtifactInfo 10, // 3: trivy.cache.v1.BlobInfo.os:type_name -> trivy.common.OS - 11, // 4: trivy.cache.v1.BlobInfo.package_infos:type_name -> trivy.common.PackageInfo - 12, // 5: trivy.cache.v1.BlobInfo.applications:type_name -> trivy.common.Application - 13, // 6: trivy.cache.v1.BlobInfo.misconfigurations:type_name -> trivy.common.Misconfiguration - 14, // 7: trivy.cache.v1.BlobInfo.custom_resources:type_name -> trivy.common.CustomResource - 2, // 8: trivy.cache.v1.PutBlobRequest.blob_info:type_name -> trivy.cache.v1.BlobInfo - 10, // 9: trivy.cache.v1.PutResponse.os:type_name -> trivy.common.OS - 1, // 10: trivy.cache.v1.Cache.PutArtifact:input_type -> trivy.cache.v1.PutArtifactRequest - 3, // 11: trivy.cache.v1.Cache.PutBlob:input_type -> trivy.cache.v1.PutBlobRequest - 5, // 12: trivy.cache.v1.Cache.MissingBlobs:input_type -> trivy.cache.v1.MissingBlobsRequest - 7, // 13: trivy.cache.v1.Cache.DeleteBlobs:input_type -> trivy.cache.v1.DeleteBlobsRequest - 15, // 14: trivy.cache.v1.Cache.PutArtifact:output_type -> google.protobuf.Empty - 15, // 15: trivy.cache.v1.Cache.PutBlob:output_type -> google.protobuf.Empty - 6, // 16: trivy.cache.v1.Cache.MissingBlobs:output_type -> trivy.cache.v1.MissingBlobsResponse - 15, // 17: trivy.cache.v1.Cache.DeleteBlobs:output_type -> google.protobuf.Empty - 14, // [14:18] is the sub-list for method output_type - 10, // [10:14] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 11, // 4: trivy.cache.v1.BlobInfo.repository:type_name -> trivy.common.Repository + 12, // 5: trivy.cache.v1.BlobInfo.package_infos:type_name -> trivy.common.PackageInfo + 13, // 6: trivy.cache.v1.BlobInfo.applications:type_name -> trivy.common.Application + 14, // 7: trivy.cache.v1.BlobInfo.misconfigurations:type_name -> trivy.common.Misconfiguration + 15, // 8: trivy.cache.v1.BlobInfo.custom_resources:type_name -> trivy.common.CustomResource + 2, // 9: trivy.cache.v1.PutBlobRequest.blob_info:type_name -> trivy.cache.v1.BlobInfo + 10, // 10: trivy.cache.v1.PutResponse.os:type_name -> trivy.common.OS + 1, // 11: trivy.cache.v1.Cache.PutArtifact:input_type -> trivy.cache.v1.PutArtifactRequest + 3, // 12: trivy.cache.v1.Cache.PutBlob:input_type -> trivy.cache.v1.PutBlobRequest + 5, // 13: trivy.cache.v1.Cache.MissingBlobs:input_type -> trivy.cache.v1.MissingBlobsRequest + 7, // 14: trivy.cache.v1.Cache.DeleteBlobs:input_type -> trivy.cache.v1.DeleteBlobsRequest + 16, // 15: trivy.cache.v1.Cache.PutArtifact:output_type -> google.protobuf.Empty + 16, // 16: trivy.cache.v1.Cache.PutBlob:output_type -> google.protobuf.Empty + 6, // 17: trivy.cache.v1.Cache.MissingBlobs:output_type -> trivy.cache.v1.MissingBlobsResponse + 16, // 18: trivy.cache.v1.Cache.DeleteBlobs:output_type -> google.protobuf.Empty + 15, // [15:19] is the sub-list for method output_type + 11, // [11:15] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_rpc_cache_service_proto_init() } diff --git a/rpc/cache/service.proto b/rpc/cache/service.proto index d0a9a9c7fbdf..f686b8552469 100644 --- a/rpc/cache/service.proto +++ b/rpc/cache/service.proto @@ -29,8 +29,9 @@ message PutArtifactRequest { } message BlobInfo { - int32 schema_version = 1; - common.OS os = 2; + int32 schema_version = 1; + common.OS os = 2; + common.Repository repository = 11; repeated common.PackageInfo package_infos = 3; repeated common.Application applications = 4; repeated common.Misconfiguration misconfigurations = 9; diff --git a/rpc/cache/service.twirp.go b/rpc/cache/service.twirp.go index eb13c2a9423c..2087821371f1 100644 --- a/rpc/cache/service.twirp.go +++ b/rpc/cache/service.twirp.go @@ -1930,54 +1930,55 @@ func callClientError(ctx context.Context, h *twirp.ClientHooks, err twirp.Error) } var twirpFileDescriptor0 = []byte{ - // 772 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xdd, 0x6e, 0xd3, 0x48, - 0x14, 0x56, 0x92, 0xb6, 0x49, 0x4e, 0x7e, 0x9a, 0x9d, 0xdd, 0x6d, 0xdd, 0x6c, 0xd5, 0x46, 0xde, - 0x5d, 0x29, 0x5c, 0x60, 0x8b, 0x00, 0x57, 0x08, 0x44, 0xda, 0x02, 0x8a, 0x44, 0x45, 0x30, 0x08, - 0x09, 0x6e, 0x82, 0x33, 0x1e, 0x27, 0xa3, 0xc6, 0x1e, 0x77, 0x66, 0x1c, 0xc8, 0x1b, 0xf0, 0x4e, - 0xbc, 0x0d, 0x4f, 0x82, 0x66, 0x6c, 0x37, 0x71, 0x92, 0x56, 0x70, 0x13, 0x79, 0xce, 0x39, 0xf3, - 0x9d, 0xef, 0x7c, 0xe7, 0xb3, 0x03, 0x87, 0x3c, 0xc2, 0x36, 0x76, 0xf1, 0x94, 0xd8, 0x82, 0xf0, - 0x39, 0xc5, 0xc4, 0x8a, 0x38, 0x93, 0x0c, 0x35, 0x25, 0xa7, 0xf3, 0x85, 0xa5, 0x53, 0xd6, 0xfc, - 0x41, 0xfb, 0x74, 0xc2, 0xd8, 0x64, 0x46, 0x6c, 0x9d, 0x1d, 0xc7, 0xbe, 0x2d, 0x69, 0x40, 0x84, - 0x74, 0x83, 0x28, 0xb9, 0xd0, 0x36, 0x34, 0x12, 0x0b, 0x02, 0x16, 0xe6, 0xa1, 0xda, 0xff, 0xac, - 0x5f, 0x25, 0x41, 0x24, 0x17, 0x49, 0xd2, 0xfc, 0x56, 0x84, 0x7a, 0x9f, 0x4b, 0xea, 0xbb, 0x58, - 0x0e, 0x42, 0x9f, 0xa1, 0xff, 0xa1, 0x29, 0xf0, 0x94, 0x04, 0xee, 0x68, 0x4e, 0xb8, 0xa0, 0x2c, - 0x34, 0x0a, 0x9d, 0x42, 0x77, 0xd7, 0x69, 0x24, 0xd1, 0x0f, 0x49, 0x10, 0x99, 0x50, 0x77, 0x39, - 0x9e, 0x52, 0x49, 0xb0, 0x8c, 0x39, 0x31, 0x8a, 0x9d, 0x42, 0xb7, 0xea, 0xe4, 0x62, 0xe8, 0x11, - 0x94, 0x31, 0x27, 0xae, 0x24, 0x9e, 0x51, 0xea, 0x14, 0xba, 0xb5, 0x5e, 0xdb, 0x4a, 0xa8, 0x58, - 0x19, 0x15, 0xeb, 0x7d, 0x36, 0x85, 0x93, 0x95, 0x2a, 0x02, 0x1e, 0xc3, 0x57, 0x84, 0xdf, 0x10, - 0xd8, 0xd1, 0xd8, 0x8d, 0x24, 0x9a, 0x11, 0x68, 0x42, 0x91, 0x09, 0x63, 0x57, 0xa7, 0x8a, 0x4c, - 0xa0, 0xe7, 0xd0, 0x9a, 0x52, 0x21, 0x19, 0x5f, 0x8c, 0x22, 0x17, 0x5f, 0xb9, 0x13, 0x22, 0x8c, - 0xbd, 0x4e, 0xa9, 0x5b, 0xeb, 0xfd, 0x6d, 0xa5, 0x5a, 0x6a, 0x71, 0xac, 0x61, 0x92, 0x75, 0xf6, - 0xd3, 0xf2, 0xf4, 0x2c, 0xcc, 0xaf, 0x80, 0x86, 0xb1, 0xcc, 0xc4, 0x70, 0xc8, 0x75, 0x4c, 0x84, - 0x44, 0xa7, 0x50, 0x73, 0xd3, 0xd0, 0x88, 0x7a, 0x5a, 0x8c, 0xaa, 0x03, 0x59, 0x68, 0xe0, 0xa1, - 0x3e, 0x34, 0x96, 0x05, 0xa1, 0xcf, 0xb4, 0x14, 0xb5, 0xde, 0xb1, 0x95, 0xdf, 0xa0, 0xb5, 0xaa, - 0xb2, 0x12, 0x6a, 0x79, 0x32, 0x7f, 0x94, 0xa0, 0x72, 0x36, 0x63, 0xe3, 0xdf, 0x59, 0x40, 0x47, - 0xcf, 0x9f, 0xf4, 0x6a, 0xe5, 0x27, 0x7c, 0xf3, 0x4e, 0x2b, 0xf2, 0x0c, 0x1a, 0xa9, 0x12, 0x9a, - 0x97, 0x30, 0x4a, 0x5a, 0x8e, 0xa3, 0xad, 0x72, 0x24, 0xac, 0xa2, 0xe5, 0x41, 0xa0, 0xa7, 0x50, - 0x77, 0xa3, 0x68, 0x46, 0xb1, 0x2b, 0x29, 0x0b, 0x85, 0xb1, 0xb3, 0xed, 0x7a, 0x7f, 0x59, 0xe1, - 0xe4, 0xca, 0xd1, 0x6b, 0xf8, 0x23, 0xa0, 0x02, 0xb3, 0xd0, 0xa7, 0x93, 0x98, 0xa7, 0x18, 0x55, - 0x8d, 0x71, 0x92, 0xc7, 0xb8, 0x5c, 0x2b, 0x73, 0x36, 0x2f, 0xaa, 0x35, 0xb0, 0xc8, 0xbd, 0x8e, - 0xc9, 0xc8, 0xa3, 0x5c, 0xed, 0xbd, 0xa4, 0xd6, 0x90, 0x84, 0x2e, 0x28, 0x17, 0x4a, 0xb6, 0x2f, - 0xca, 0x7a, 0x2c, 0x96, 0x23, 0x9f, 0xce, 0xd2, 0xed, 0x57, 0x9d, 0x46, 0x16, 0x7d, 0xa9, 0x82, - 0xe8, 0x00, 0xf6, 0x3c, 0x3a, 0x21, 0x42, 0x1a, 0x65, 0xbd, 0xc9, 0xf4, 0x84, 0x0e, 0xa1, 0xec, - 0x51, 0xdf, 0x57, 0x2b, 0xae, 0x64, 0x09, 0xdf, 0x1f, 0x78, 0xe8, 0x15, 0xb4, 0x70, 0x2c, 0x24, - 0x0b, 0x46, 0x9c, 0x08, 0x16, 0x73, 0x4c, 0x84, 0x01, 0x7a, 0x8a, 0xe3, 0xfc, 0x14, 0xe7, 0xba, - 0xca, 0x49, 0x8b, 0x9c, 0x7d, 0x9c, 0x3b, 0x0b, 0xf3, 0x33, 0x34, 0x87, 0xb1, 0x54, 0x6b, 0xce, - 0xac, 0xb5, 0xd2, 0xb3, 0x90, 0xeb, 0xf9, 0x18, 0xaa, 0xe3, 0x19, 0x1b, 0x27, 0x76, 0x4a, 0x5e, - 0x1d, 0x63, 0xdd, 0x4e, 0x99, 0x5f, 0x9c, 0xca, 0x38, 0x7d, 0x32, 0xcf, 0xa1, 0x36, 0x8c, 0xa5, - 0x43, 0x44, 0xc4, 0x42, 0x41, 0x52, 0x87, 0x14, 0xee, 0x70, 0x08, 0x82, 0x1d, 0xc2, 0xc4, 0x4c, - 0xbb, 0xa8, 0xe2, 0xe8, 0x67, 0xf3, 0x2d, 0xfc, 0x79, 0x49, 0x85, 0xa0, 0xe1, 0x44, 0x75, 0x10, - 0xbf, 0xfc, 0x1a, 0x1c, 0x41, 0x25, 0xe1, 0xec, 0x29, 0x57, 0x2a, 0xe5, 0xcb, 0x9a, 0x98, 0x27, - 0xcc, 0x2b, 0xf8, 0x2b, 0x0f, 0x99, 0x12, 0xbc, 0x07, 0xad, 0x20, 0x89, 0x8f, 0x32, 0x20, 0x0d, - 0x5c, 0x71, 0xf6, 0xd3, 0x78, 0xf6, 0xce, 0xa0, 0xee, 0xb2, 0x74, 0xad, 0x4b, 0x33, 0x58, 0x42, - 0xab, 0x66, 0x36, 0xa0, 0x0b, 0x32, 0x23, 0x92, 0xe4, 0xe8, 0xaf, 0xb2, 0x2b, 0xe4, 0xd8, 0xf5, - 0xbe, 0x17, 0x61, 0xf7, 0x5c, 0xa9, 0x8a, 0x06, 0x5a, 0xbf, 0x9b, 0x9e, 0xe6, 0xba, 0xe4, 0x9b, - 0x5f, 0x87, 0xf6, 0xc1, 0xc6, 0x17, 0xed, 0x85, 0xfa, 0xb8, 0xa2, 0x3e, 0x94, 0xd3, 0x65, 0xa3, - 0x93, 0x2d, 0x30, 0x2b, 0x2e, 0xb8, 0x15, 0xe2, 0x23, 0xd4, 0x57, 0x55, 0x43, 0xff, 0xae, 0xe3, - 0x6c, 0x59, 0x53, 0xfb, 0xbf, 0xbb, 0x8b, 0x52, 0xe1, 0x07, 0x50, 0x5b, 0xd1, 0x68, 0x73, 0xd0, - 0x4d, 0x01, 0x6f, 0x63, 0x79, 0x66, 0x7f, 0xba, 0x3f, 0xa1, 0x72, 0x1a, 0x8f, 0x95, 0xb5, 0x6c, - 0xf7, 0x3a, 0x76, 0x05, 0xc1, 0x31, 0xa7, 0x72, 0x61, 0x6b, 0x50, 0xfb, 0xe6, 0x0f, 0xee, 0x89, - 0xfe, 0x1d, 0xef, 0x69, 0x80, 0x87, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xec, 0x7d, 0x3a, 0x0b, - 0xfa, 0x06, 0x00, 0x00, + // 791 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xed, 0x6e, 0xeb, 0x44, + 0x10, 0x55, 0x3e, 0xda, 0x24, 0x93, 0x8f, 0x86, 0x05, 0x5a, 0x37, 0x54, 0x6d, 0x64, 0x40, 0x0a, + 0x3f, 0xb0, 0x45, 0x00, 0x09, 0x09, 0x81, 0x48, 0x5b, 0x40, 0x91, 0xa8, 0x08, 0x0b, 0x42, 0x82, + 0x3f, 0xc1, 0x59, 0xaf, 0x93, 0x55, 0x63, 0xaf, 0xbb, 0xbb, 0x0e, 0xe4, 0x0d, 0x78, 0x88, 0xfb, + 0x26, 0xf7, 0xe5, 0xae, 0x76, 0x6d, 0x27, 0x71, 0x92, 0x56, 0xf7, 0xfe, 0x89, 0xbc, 0x33, 0x67, + 0xcf, 0xcc, 0x9c, 0x39, 0x76, 0xe0, 0x42, 0xc4, 0xc4, 0x25, 0x1e, 0x59, 0x50, 0x57, 0x52, 0xb1, + 0x62, 0x84, 0x3a, 0xb1, 0xe0, 0x8a, 0xa3, 0x8e, 0x12, 0x6c, 0xb5, 0x76, 0x4c, 0xca, 0x59, 0x7d, + 0xd1, 0xbb, 0x99, 0x73, 0x3e, 0x5f, 0x52, 0xd7, 0x64, 0x67, 0x49, 0xe0, 0x2a, 0x16, 0x52, 0xa9, + 0xbc, 0x30, 0x4e, 0x2f, 0xf4, 0x2c, 0xc3, 0xc4, 0xc3, 0x90, 0x47, 0x45, 0xaa, 0xde, 0x47, 0xfb, + 0x57, 0x69, 0x18, 0xab, 0x75, 0x9a, 0xb4, 0xff, 0x2f, 0x43, 0x6b, 0x24, 0x14, 0x0b, 0x3c, 0xa2, + 0xc6, 0x51, 0xc0, 0xd1, 0xa7, 0xd0, 0x91, 0x64, 0x41, 0x43, 0x6f, 0xba, 0xa2, 0x42, 0x32, 0x1e, + 0x59, 0xa5, 0x7e, 0x69, 0x70, 0x82, 0xdb, 0x69, 0xf4, 0xcf, 0x34, 0x88, 0x6c, 0x68, 0x79, 0x82, + 0x2c, 0x98, 0xa2, 0x44, 0x25, 0x82, 0x5a, 0xe5, 0x7e, 0x69, 0xd0, 0xc0, 0x85, 0x18, 0xfa, 0x0a, + 0x6a, 0x44, 0x50, 0x4f, 0x51, 0xdf, 0xaa, 0xf4, 0x4b, 0x83, 0xe6, 0xb0, 0xe7, 0xa4, 0xad, 0x38, + 0x79, 0x2b, 0xce, 0x1f, 0xf9, 0x14, 0x38, 0x87, 0xea, 0x06, 0x7c, 0x4e, 0x1e, 0xa9, 0xd8, 0x34, + 0x50, 0x35, 0xdc, 0xed, 0x34, 0x9a, 0x37, 0xd0, 0x81, 0x32, 0x97, 0xd6, 0x89, 0x49, 0x95, 0xb9, + 0x44, 0x3f, 0x40, 0x77, 0xc1, 0xa4, 0xe2, 0x62, 0x3d, 0x8d, 0x3d, 0xf2, 0xe8, 0xcd, 0xa9, 0xb4, + 0x4e, 0xfb, 0x95, 0x41, 0x73, 0xf8, 0xa1, 0x93, 0x69, 0x69, 0xc4, 0x71, 0x26, 0x69, 0x16, 0x9f, + 0x65, 0xf0, 0xec, 0x2c, 0xed, 0xff, 0x00, 0x4d, 0x12, 0x95, 0x8b, 0x81, 0xe9, 0x53, 0x42, 0xa5, + 0x42, 0x37, 0xd0, 0xf4, 0xb2, 0xd0, 0x94, 0xf9, 0x46, 0x8c, 0x06, 0x86, 0x3c, 0x34, 0xf6, 0xd1, + 0x08, 0xda, 0x5b, 0x40, 0x14, 0x70, 0x23, 0x45, 0x73, 0x78, 0xe5, 0x14, 0x37, 0xe8, 0xec, 0xaa, + 0xac, 0x85, 0xda, 0x9e, 0xec, 0x57, 0x55, 0xa8, 0xdf, 0x2e, 0xf9, 0xec, 0x5d, 0x16, 0xd0, 0x37, + 0xf3, 0xa7, 0xb5, 0xba, 0xc5, 0x09, 0x7f, 0xfd, 0xdd, 0x28, 0xf2, 0x0d, 0x80, 0xa0, 0x31, 0x97, + 0x4c, 0x4f, 0x69, 0x35, 0x0d, 0xd2, 0x2a, 0x22, 0xf1, 0x26, 0x8f, 0x77, 0xb0, 0xe8, 0x7b, 0x68, + 0x67, 0x1a, 0x9a, 0x89, 0xa4, 0x55, 0x31, 0x42, 0x5e, 0x1e, 0x15, 0x32, 0x9d, 0x27, 0xde, 0x1e, + 0x24, 0xfa, 0x0e, 0x5a, 0x5e, 0x1c, 0x2f, 0x19, 0xf1, 0x14, 0xe3, 0x91, 0xb4, 0xaa, 0xc7, 0xae, + 0x8f, 0xb6, 0x08, 0x5c, 0x80, 0xa3, 0x5f, 0xe0, 0xbd, 0x90, 0x49, 0xc2, 0xa3, 0x80, 0xcd, 0x13, + 0x91, 0x71, 0x34, 0x0c, 0xc7, 0x75, 0x91, 0xe3, 0x61, 0x0f, 0x86, 0x0f, 0x2f, 0xea, 0x05, 0xf2, + 0xd8, 0x7b, 0x4a, 0xe8, 0xd4, 0x67, 0x42, 0x3b, 0xa6, 0xa2, 0x17, 0x98, 0x86, 0xee, 0x99, 0x90, + 0x5a, 0xf0, 0x7f, 0xb5, 0x69, 0x79, 0xa2, 0xa6, 0x01, 0x5b, 0x66, 0xbe, 0x69, 0xe0, 0x76, 0x1e, + 0xfd, 0x49, 0x07, 0xd1, 0x39, 0x9c, 0xfa, 0x6c, 0x4e, 0xa5, 0xb2, 0x6a, 0xc6, 0x03, 0xd9, 0x09, + 0x5d, 0x40, 0xcd, 0x67, 0x41, 0xa0, 0xcd, 0x51, 0xcf, 0x13, 0x41, 0x30, 0xf6, 0xd1, 0xcf, 0xd0, + 0x25, 0x89, 0x54, 0x3c, 0x9c, 0x0a, 0x2a, 0x79, 0x22, 0x08, 0x95, 0x16, 0x98, 0x29, 0xae, 0x8a, + 0x53, 0xdc, 0x19, 0x14, 0xce, 0x40, 0xf8, 0x8c, 0x14, 0xce, 0xd2, 0xfe, 0x07, 0x3a, 0x93, 0x44, + 0x69, 0x83, 0xe4, 0xa6, 0xdc, 0xa9, 0x59, 0x2a, 0xd4, 0xfc, 0x1a, 0x1a, 0xb3, 0x25, 0x9f, 0xa5, + 0x46, 0xac, 0x14, 0x57, 0x9e, 0x1b, 0x31, 0x77, 0x1a, 0xae, 0xcf, 0xb2, 0x27, 0xfb, 0x0e, 0x9a, + 0x93, 0x44, 0x61, 0x2a, 0x63, 0x1e, 0x49, 0x9a, 0x79, 0xab, 0xf4, 0x82, 0xb7, 0x10, 0x54, 0x29, + 0x97, 0x4b, 0xe3, 0xbf, 0x3a, 0x36, 0xcf, 0xf6, 0x6f, 0xf0, 0xfe, 0x03, 0x93, 0x92, 0x45, 0x73, + 0x5d, 0x41, 0xbe, 0xf5, 0x0b, 0x74, 0x09, 0xf5, 0xb4, 0x67, 0x5f, 0xfb, 0x59, 0x2b, 0x5f, 0x33, + 0x8d, 0xf9, 0xd2, 0x7e, 0x84, 0x0f, 0x8a, 0x94, 0x59, 0x83, 0x9f, 0x41, 0x37, 0x4c, 0xe3, 0xd3, + 0x9c, 0xc8, 0x10, 0xd7, 0xf1, 0x59, 0x16, 0xcf, 0xdf, 0x36, 0x34, 0xd8, 0x42, 0xf7, 0xaa, 0x74, + 0xc2, 0x2d, 0xb5, 0x2e, 0xe6, 0x02, 0xba, 0xa7, 0x4b, 0xaa, 0x68, 0xa1, 0xfd, 0xdd, 0xee, 0x4a, + 0x85, 0xee, 0x86, 0xaf, 0xcb, 0x70, 0x72, 0xa7, 0x55, 0x45, 0x63, 0xa3, 0xdf, 0xa6, 0xa6, 0xbd, + 0x2f, 0xf9, 0xe1, 0x77, 0xa5, 0x77, 0x7e, 0xf0, 0x2d, 0xfc, 0x51, 0x7f, 0x96, 0xd1, 0x08, 0x6a, + 0xd9, 0xb2, 0xd1, 0xf5, 0x11, 0x9a, 0x1d, 0x17, 0x3c, 0x4b, 0xf1, 0x17, 0xb4, 0x76, 0x55, 0x43, + 0x1f, 0xef, 0xf3, 0x1c, 0x59, 0x53, 0xef, 0x93, 0x97, 0x41, 0x99, 0xf0, 0x63, 0x68, 0xee, 0x68, + 0x74, 0x38, 0xe8, 0xa1, 0x80, 0xcf, 0x75, 0x79, 0xeb, 0xfe, 0xfd, 0xf9, 0x9c, 0xa9, 0x45, 0x32, + 0xd3, 0xd6, 0x72, 0xbd, 0xa7, 0xc4, 0x93, 0x94, 0x24, 0x82, 0xa9, 0xb5, 0x6b, 0x48, 0xdd, 0xcd, + 0x5f, 0xe3, 0xb7, 0xe6, 0x77, 0x76, 0x6a, 0x08, 0xbe, 0x7c, 0x13, 0x00, 0x00, 0xff, 0xff, 0x9b, + 0xb2, 0xf3, 0x95, 0x34, 0x07, 0x00, 0x00, } diff --git a/rpc/common/service.pb.go b/rpc/common/service.pb.go index b2f341b87fc2..062ac8b759ee 100644 --- a/rpc/common/service.pb.go +++ b/rpc/common/service.pb.go @@ -140,6 +140,61 @@ func (x *OS) GetEosl() bool { return false } +type Repository struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Family string `protobuf:"bytes,1,opt,name=family,proto3" json:"family,omitempty"` + Release string `protobuf:"bytes,2,opt,name=release,proto3" json:"release,omitempty"` +} + +func (x *Repository) Reset() { + *x = Repository{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_common_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Repository) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Repository) ProtoMessage() {} + +func (x *Repository) ProtoReflect() protoreflect.Message { + mi := &file_rpc_common_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Repository.ProtoReflect.Descriptor instead. +func (*Repository) Descriptor() ([]byte, []int) { + return file_rpc_common_service_proto_rawDescGZIP(), []int{1} +} + +func (x *Repository) GetFamily() string { + if x != nil { + return x.Family + } + return "" +} + +func (x *Repository) GetRelease() string { + if x != nil { + return x.Release + } + return "" +} + type PackageInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -152,7 +207,7 @@ type PackageInfo struct { func (x *PackageInfo) Reset() { *x = PackageInfo{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[1] + mi := &file_rpc_common_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -165,7 +220,7 @@ func (x *PackageInfo) String() string { func (*PackageInfo) ProtoMessage() {} func (x *PackageInfo) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[1] + mi := &file_rpc_common_service_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -178,7 +233,7 @@ func (x *PackageInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use PackageInfo.ProtoReflect.Descriptor instead. func (*PackageInfo) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{1} + return file_rpc_common_service_proto_rawDescGZIP(), []int{2} } func (x *PackageInfo) GetFilePath() string { @@ -208,7 +263,7 @@ type Application struct { func (x *Application) Reset() { *x = Application{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[2] + mi := &file_rpc_common_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -221,7 +276,7 @@ func (x *Application) String() string { func (*Application) ProtoMessage() {} func (x *Application) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[2] + mi := &file_rpc_common_service_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -234,7 +289,7 @@ func (x *Application) ProtoReflect() protoreflect.Message { // Deprecated: Use Application.ProtoReflect.Descriptor instead. func (*Application) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{2} + return file_rpc_common_service_proto_rawDescGZIP(), []int{3} } func (x *Application) GetType() string { @@ -284,7 +339,7 @@ type Package struct { func (x *Package) Reset() { *x = Package{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[3] + mi := &file_rpc_common_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -297,7 +352,7 @@ func (x *Package) String() string { func (*Package) ProtoMessage() {} func (x *Package) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[3] + mi := &file_rpc_common_service_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -310,7 +365,7 @@ func (x *Package) ProtoReflect() protoreflect.Message { // Deprecated: Use Package.ProtoReflect.Descriptor instead. func (*Package) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{3} + return file_rpc_common_service_proto_rawDescGZIP(), []int{4} } func (x *Package) GetName() string { @@ -413,7 +468,7 @@ type Misconfiguration struct { func (x *Misconfiguration) Reset() { *x = Misconfiguration{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[4] + mi := &file_rpc_common_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -426,7 +481,7 @@ func (x *Misconfiguration) String() string { func (*Misconfiguration) ProtoMessage() {} func (x *Misconfiguration) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[4] + mi := &file_rpc_common_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -439,7 +494,7 @@ func (x *Misconfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use Misconfiguration.ProtoReflect.Descriptor instead. func (*Misconfiguration) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{4} + return file_rpc_common_service_proto_rawDescGZIP(), []int{5} } func (x *Misconfiguration) GetFileType() string { @@ -500,7 +555,7 @@ type MisconfResult struct { func (x *MisconfResult) Reset() { *x = MisconfResult{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[5] + mi := &file_rpc_common_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -513,7 +568,7 @@ func (x *MisconfResult) String() string { func (*MisconfResult) ProtoMessage() {} func (x *MisconfResult) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[5] + mi := &file_rpc_common_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -526,7 +581,7 @@ func (x *MisconfResult) ProtoReflect() protoreflect.Message { // Deprecated: Use MisconfResult.ProtoReflect.Descriptor instead. func (*MisconfResult) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{5} + return file_rpc_common_service_proto_rawDescGZIP(), []int{6} } func (x *MisconfResult) GetNamespace() string { @@ -593,7 +648,7 @@ type DetectedMisconfiguration struct { func (x *DetectedMisconfiguration) Reset() { *x = DetectedMisconfiguration{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[6] + mi := &file_rpc_common_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -606,7 +661,7 @@ func (x *DetectedMisconfiguration) String() string { func (*DetectedMisconfiguration) ProtoMessage() {} func (x *DetectedMisconfiguration) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[6] + mi := &file_rpc_common_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -619,7 +674,7 @@ func (x *DetectedMisconfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use DetectedMisconfiguration.ProtoReflect.Descriptor instead. func (*DetectedMisconfiguration) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{6} + return file_rpc_common_service_proto_rawDescGZIP(), []int{7} } func (x *DetectedMisconfiguration) GetType() string { @@ -737,7 +792,7 @@ type Vulnerability struct { func (x *Vulnerability) Reset() { *x = Vulnerability{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[7] + mi := &file_rpc_common_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -750,7 +805,7 @@ func (x *Vulnerability) String() string { func (*Vulnerability) ProtoMessage() {} func (x *Vulnerability) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[7] + mi := &file_rpc_common_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -763,7 +818,7 @@ func (x *Vulnerability) ProtoReflect() protoreflect.Message { // Deprecated: Use Vulnerability.ProtoReflect.Descriptor instead. func (*Vulnerability) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{7} + return file_rpc_common_service_proto_rawDescGZIP(), []int{8} } func (x *Vulnerability) GetVulnerabilityId() string { @@ -926,7 +981,7 @@ type DataSource struct { func (x *DataSource) Reset() { *x = DataSource{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[8] + mi := &file_rpc_common_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -939,7 +994,7 @@ func (x *DataSource) String() string { func (*DataSource) ProtoMessage() {} func (x *DataSource) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[8] + mi := &file_rpc_common_service_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -952,7 +1007,7 @@ func (x *DataSource) ProtoReflect() protoreflect.Message { // Deprecated: Use DataSource.ProtoReflect.Descriptor instead. func (*DataSource) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{8} + return file_rpc_common_service_proto_rawDescGZIP(), []int{9} } func (x *DataSource) GetId() string { @@ -988,7 +1043,7 @@ type Layer struct { func (x *Layer) Reset() { *x = Layer{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[9] + mi := &file_rpc_common_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1001,7 +1056,7 @@ func (x *Layer) String() string { func (*Layer) ProtoMessage() {} func (x *Layer) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[9] + mi := &file_rpc_common_service_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1014,7 +1069,7 @@ func (x *Layer) ProtoReflect() protoreflect.Message { // Deprecated: Use Layer.ProtoReflect.Descriptor instead. func (*Layer) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{9} + return file_rpc_common_service_proto_rawDescGZIP(), []int{10} } func (x *Layer) GetDigest() string { @@ -1045,7 +1100,7 @@ type CVSS struct { func (x *CVSS) Reset() { *x = CVSS{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[10] + mi := &file_rpc_common_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1058,7 +1113,7 @@ func (x *CVSS) String() string { func (*CVSS) ProtoMessage() {} func (x *CVSS) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[10] + mi := &file_rpc_common_service_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1071,7 +1126,7 @@ func (x *CVSS) ProtoReflect() protoreflect.Message { // Deprecated: Use CVSS.ProtoReflect.Descriptor instead. func (*CVSS) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{10} + return file_rpc_common_service_proto_rawDescGZIP(), []int{11} } func (x *CVSS) GetV2Vector() string { @@ -1116,7 +1171,7 @@ type CustomResource struct { func (x *CustomResource) Reset() { *x = CustomResource{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_common_service_proto_msgTypes[11] + mi := &file_rpc_common_service_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1129,7 +1184,7 @@ func (x *CustomResource) String() string { func (*CustomResource) ProtoMessage() {} func (x *CustomResource) ProtoReflect() protoreflect.Message { - mi := &file_rpc_common_service_proto_msgTypes[11] + mi := &file_rpc_common_service_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1142,7 +1197,7 @@ func (x *CustomResource) ProtoReflect() protoreflect.Message { // Deprecated: Use CustomResource.ProtoReflect.Descriptor instead. func (*CustomResource) Descriptor() ([]byte, []int) { - return file_rpc_common_service_proto_rawDescGZIP(), []int{11} + return file_rpc_common_service_proto_rawDescGZIP(), []int{12} } func (x *CustomResource) GetType() string { @@ -1186,7 +1241,11 @@ var file_rpc_common_service_proto_rawDesc = []byte{ 0x06, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x6f, 0x73, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x65, 0x6f, 0x73, 0x6c, 0x22, 0x5d, 0x0a, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x65, 0x6f, 0x73, 0x6c, 0x22, 0x3e, 0x0a, + 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x66, + 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x61, 0x6d, + 0x69, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x5d, 0x0a, 0x0b, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x31, 0x0a, 0x08, 0x70, 0x61, 0x63, @@ -1397,48 +1456,49 @@ func file_rpc_common_service_proto_rawDescGZIP() []byte { } var file_rpc_common_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_rpc_common_service_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_rpc_common_service_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_rpc_common_service_proto_goTypes = []interface{}{ (Severity)(0), // 0: trivy.common.Severity (*OS)(nil), // 1: trivy.common.OS - (*PackageInfo)(nil), // 2: trivy.common.PackageInfo - (*Application)(nil), // 3: trivy.common.Application - (*Package)(nil), // 4: trivy.common.Package - (*Misconfiguration)(nil), // 5: trivy.common.Misconfiguration - (*MisconfResult)(nil), // 6: trivy.common.MisconfResult - (*DetectedMisconfiguration)(nil), // 7: trivy.common.DetectedMisconfiguration - (*Vulnerability)(nil), // 8: trivy.common.Vulnerability - (*DataSource)(nil), // 9: trivy.common.DataSource - (*Layer)(nil), // 10: trivy.common.Layer - (*CVSS)(nil), // 11: trivy.common.CVSS - (*CustomResource)(nil), // 12: trivy.common.CustomResource - nil, // 13: trivy.common.Vulnerability.CvssEntry - nil, // 14: trivy.common.Vulnerability.VendorSeverityEntry - (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp - (*structpb.Value)(nil), // 16: google.protobuf.Value + (*Repository)(nil), // 2: trivy.common.Repository + (*PackageInfo)(nil), // 3: trivy.common.PackageInfo + (*Application)(nil), // 4: trivy.common.Application + (*Package)(nil), // 5: trivy.common.Package + (*Misconfiguration)(nil), // 6: trivy.common.Misconfiguration + (*MisconfResult)(nil), // 7: trivy.common.MisconfResult + (*DetectedMisconfiguration)(nil), // 8: trivy.common.DetectedMisconfiguration + (*Vulnerability)(nil), // 9: trivy.common.Vulnerability + (*DataSource)(nil), // 10: trivy.common.DataSource + (*Layer)(nil), // 11: trivy.common.Layer + (*CVSS)(nil), // 12: trivy.common.CVSS + (*CustomResource)(nil), // 13: trivy.common.CustomResource + nil, // 14: trivy.common.Vulnerability.CvssEntry + nil, // 15: trivy.common.Vulnerability.VendorSeverityEntry + (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp + (*structpb.Value)(nil), // 17: google.protobuf.Value } var file_rpc_common_service_proto_depIdxs = []int32{ - 4, // 0: trivy.common.PackageInfo.packages:type_name -> trivy.common.Package - 4, // 1: trivy.common.Application.libraries:type_name -> trivy.common.Package - 10, // 2: trivy.common.Package.layer:type_name -> trivy.common.Layer - 6, // 3: trivy.common.Misconfiguration.successes:type_name -> trivy.common.MisconfResult - 6, // 4: trivy.common.Misconfiguration.warnings:type_name -> trivy.common.MisconfResult - 6, // 5: trivy.common.Misconfiguration.failures:type_name -> trivy.common.MisconfResult - 6, // 6: trivy.common.Misconfiguration.exceptions:type_name -> trivy.common.MisconfResult + 5, // 0: trivy.common.PackageInfo.packages:type_name -> trivy.common.Package + 5, // 1: trivy.common.Application.libraries:type_name -> trivy.common.Package + 11, // 2: trivy.common.Package.layer:type_name -> trivy.common.Layer + 7, // 3: trivy.common.Misconfiguration.successes:type_name -> trivy.common.MisconfResult + 7, // 4: trivy.common.Misconfiguration.warnings:type_name -> trivy.common.MisconfResult + 7, // 5: trivy.common.Misconfiguration.failures:type_name -> trivy.common.MisconfResult + 7, // 6: trivy.common.Misconfiguration.exceptions:type_name -> trivy.common.MisconfResult 0, // 7: trivy.common.DetectedMisconfiguration.severity:type_name -> trivy.common.Severity - 10, // 8: trivy.common.DetectedMisconfiguration.layer:type_name -> trivy.common.Layer + 11, // 8: trivy.common.DetectedMisconfiguration.layer:type_name -> trivy.common.Layer 0, // 9: trivy.common.Vulnerability.severity:type_name -> trivy.common.Severity - 10, // 10: trivy.common.Vulnerability.layer:type_name -> trivy.common.Layer - 13, // 11: trivy.common.Vulnerability.cvss:type_name -> trivy.common.Vulnerability.CvssEntry - 15, // 12: trivy.common.Vulnerability.published_date:type_name -> google.protobuf.Timestamp - 15, // 13: trivy.common.Vulnerability.last_modified_date:type_name -> google.protobuf.Timestamp - 16, // 14: trivy.common.Vulnerability.custom_advisory_data:type_name -> google.protobuf.Value - 16, // 15: trivy.common.Vulnerability.custom_vuln_data:type_name -> google.protobuf.Value - 9, // 16: trivy.common.Vulnerability.data_source:type_name -> trivy.common.DataSource - 14, // 17: trivy.common.Vulnerability.vendor_severity:type_name -> trivy.common.Vulnerability.VendorSeverityEntry - 10, // 18: trivy.common.CustomResource.layer:type_name -> trivy.common.Layer - 16, // 19: trivy.common.CustomResource.data:type_name -> google.protobuf.Value - 11, // 20: trivy.common.Vulnerability.CvssEntry.value:type_name -> trivy.common.CVSS + 11, // 10: trivy.common.Vulnerability.layer:type_name -> trivy.common.Layer + 14, // 11: trivy.common.Vulnerability.cvss:type_name -> trivy.common.Vulnerability.CvssEntry + 16, // 12: trivy.common.Vulnerability.published_date:type_name -> google.protobuf.Timestamp + 16, // 13: trivy.common.Vulnerability.last_modified_date:type_name -> google.protobuf.Timestamp + 17, // 14: trivy.common.Vulnerability.custom_advisory_data:type_name -> google.protobuf.Value + 17, // 15: trivy.common.Vulnerability.custom_vuln_data:type_name -> google.protobuf.Value + 10, // 16: trivy.common.Vulnerability.data_source:type_name -> trivy.common.DataSource + 15, // 17: trivy.common.Vulnerability.vendor_severity:type_name -> trivy.common.Vulnerability.VendorSeverityEntry + 11, // 18: trivy.common.CustomResource.layer:type_name -> trivy.common.Layer + 17, // 19: trivy.common.CustomResource.data:type_name -> google.protobuf.Value + 12, // 20: trivy.common.Vulnerability.CvssEntry.value:type_name -> trivy.common.CVSS 0, // 21: trivy.common.Vulnerability.VendorSeverityEntry.value:type_name -> trivy.common.Severity 22, // [22:22] is the sub-list for method output_type 22, // [22:22] is the sub-list for method input_type @@ -1466,7 +1526,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackageInfo); i { + switch v := v.(*Repository); i { case 0: return &v.state case 1: @@ -1478,7 +1538,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Application); i { + switch v := v.(*PackageInfo); i { case 0: return &v.state case 1: @@ -1490,7 +1550,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Package); i { + switch v := v.(*Application); i { case 0: return &v.state case 1: @@ -1502,7 +1562,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Misconfiguration); i { + switch v := v.(*Package); i { case 0: return &v.state case 1: @@ -1514,7 +1574,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MisconfResult); i { + switch v := v.(*Misconfiguration); i { case 0: return &v.state case 1: @@ -1526,7 +1586,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DetectedMisconfiguration); i { + switch v := v.(*MisconfResult); i { case 0: return &v.state case 1: @@ -1538,7 +1598,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Vulnerability); i { + switch v := v.(*DetectedMisconfiguration); i { case 0: return &v.state case 1: @@ -1550,7 +1610,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataSource); i { + switch v := v.(*Vulnerability); i { case 0: return &v.state case 1: @@ -1562,7 +1622,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Layer); i { + switch v := v.(*DataSource); i { case 0: return &v.state case 1: @@ -1574,7 +1634,7 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CVSS); i { + switch v := v.(*Layer); i { case 0: return &v.state case 1: @@ -1586,6 +1646,18 @@ func file_rpc_common_service_proto_init() { } } file_rpc_common_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CVSS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_common_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CustomResource); i { case 0: return &v.state @@ -1604,7 +1676,7 @@ func file_rpc_common_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_rpc_common_service_proto_rawDesc, NumEnums: 1, - NumMessages: 14, + NumMessages: 15, NumExtensions: 0, NumServices: 0, }, diff --git a/rpc/common/service.proto b/rpc/common/service.proto index 27ae3512f8e0..b3debea7cf64 100644 --- a/rpc/common/service.proto +++ b/rpc/common/service.proto @@ -13,6 +13,11 @@ message OS { bool eosl = 3; } +message Repository { + string family = 1; + string release = 2; +} + message PackageInfo { string file_path = 1; repeated Package packages = 2; @@ -96,7 +101,7 @@ message Vulnerability { google.protobuf.Value custom_vuln_data = 18; repeated string vendor_ids = 19; DataSource data_source = 20; - map vendor_severity = 21; + map vendor_severity = 21; string pkg_path = 22; }