Added support for list all packages flag in client (#1032)

* Added support for list all packages flag in client

This commit is to support --list-all_pkgs argument in client command
Example command: trivy -d client --list-all-pkgs --remote http://localhost:8080 ubuntu:18.04.

* Updated argument in client.md

* Fixed all format issues
This commit is contained in:
tonaim
2021-06-04 01:17:48 +05:30
committed by GitHub
parent fb19abd09a
commit e4c32cdb77
10 changed files with 94 additions and 62 deletions

View File

@@ -87,6 +87,7 @@ func (m *ScanRequest) GetOptions() *ScanOptions {
type ScanOptions struct {
VulnType []string `protobuf:"bytes,1,rep,name=vuln_type,json=vulnType,proto3" json:"vuln_type,omitempty"`
SecurityChecks []string `protobuf:"bytes,2,rep,name=security_checks,json=securityChecks,proto3" json:"security_checks,omitempty"`
ListAllPackages bool `protobuf:"varint,3,opt,name=list_all_packages,json=listAllPackages,proto3" json:"list_all_packages,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -131,6 +132,13 @@ func (m *ScanOptions) GetSecurityChecks() []string {
return nil
}
func (m *ScanOptions) GetListAllPackages() bool {
if m != nil {
return m.ListAllPackages
}
return false
}
type ScanResponse struct {
Os *common.OS `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"`
Eosl bool `protobuf:"varint,2,opt,name=eosl,proto3" json:"eosl,omitempty"`
@@ -191,6 +199,7 @@ type Result struct {
Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
Vulnerabilities []*common.Vulnerability `protobuf:"bytes,2,rep,name=vulnerabilities,proto3" json:"vulnerabilities,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
Packages []*common.Package `protobuf:"bytes,4,rep,name=packages,proto3" json:"packages,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -242,6 +251,13 @@ func (m *Result) GetType() string {
return ""
}
func (m *Result) GetPackages() []*common.Package {
if m != nil {
return m.Packages
}
return nil
}
func init() {
proto.RegisterType((*ScanRequest)(nil), "trivy.scanner.v1.ScanRequest")
proto.RegisterType((*ScanOptions)(nil), "trivy.scanner.v1.ScanOptions")
@@ -249,33 +265,38 @@ func init() {
proto.RegisterType((*Result)(nil), "trivy.scanner.v1.Result")
}
func init() { proto.RegisterFile("rpc/scanner/service.proto", fileDescriptor_60d0e837512b18d4) }
func init() {
proto.RegisterFile("rpc/scanner/service.proto", fileDescriptor_60d0e837512b18d4)
}
var fileDescriptor_60d0e837512b18d4 = []byte{
// 395 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x8f, 0x9b, 0x30,
0x10, 0x85, 0x05, 0x89, 0x42, 0x18, 0xaa, 0xee, 0xca, 0x87, 0x8a, 0xdd, 0x55, 0x5b, 0xc4, 0xa5,
0x39, 0x81, 0x4a, 0xa5, 0xf6, 0xde, 0x2a, 0x87, 0x9c, 0x52, 0x99, 0xaa, 0x87, 0x5e, 0x90, 0x31,
0x6e, 0x62, 0x95, 0x60, 0x62, 0x1b, 0x54, 0xd4, 0x7f, 0xd2, 0x5f, 0x5b, 0x61, 0x83, 0xd4, 0x64,
0x95, 0xdb, 0xf8, 0xcd, 0x63, 0x78, 0xdf, 0xd8, 0xf0, 0x20, 0x5b, 0x9a, 0x2a, 0x4a, 0x9a, 0x86,
0xc9, 0x54, 0x31, 0xd9, 0x73, 0xca, 0x92, 0x56, 0x0a, 0x2d, 0xd0, 0xbd, 0x96, 0xbc, 0x1f, 0x92,
0xa9, 0x99, 0xf4, 0xef, 0x1f, 0x3f, 0x1e, 0xb8, 0x3e, 0x76, 0x65, 0x42, 0xc5, 0x29, 0x25, 0xe7,
0x8e, 0x28, 0x46, 0x3b, 0xc9, 0xf5, 0x90, 0x1a, 0x67, 0x3a, 0x8e, 0xa2, 0xe2, 0x74, 0x12, 0xcd,
0x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x1f, 0x58, 0x59, 0xe9, 0xe6, 0x96, 0xb7, 0x70, 0x37,
0x02, 0x31, 0x49, 0x4a, 0x5e, 0x73, 0xcd, 0x99, 0x85, 0x08, 0xb2, 0xa7, 0xcb, 0x60, 0xdf, 0xff,
0x33, 0x0d, 0xf8, 0xfa, 0x9b, 0x31, 0xb0, 0xd9, 0xd1, 0xc2, 0x0c, 0x37, 0x75, 0xf6, 0x15, 0xbc,
0xdc, 0x46, 0x43, 0x5b, 0x58, 0x8e, 0x25, 0xba, 0x71, 0x0d, 0xd3, 0x53, 0x78, 0x7c, 0x73, 0xab,
0x6d, 0x17, 0xf7, 0xd9, 0xff, 0xe1, 0x4d, 0xad, 0x72, 0x65, 0x1e, 0xd3, 0x87, 0x7f, 0x01, 0x00,
0x00, 0xff, 0xff, 0xfd, 0x72, 0xf0, 0x54, 0xb3, 0x02, 0x00, 0x00,
// 443 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x4f, 0x6f, 0xd3, 0x30,
0x1c, 0x55, 0xda, 0xaa, 0x49, 0x7f, 0x41, 0x74, 0x58, 0x02, 0x65, 0x9b, 0x80, 0xaa, 0x17, 0x2a,
0x0e, 0x89, 0x16, 0x24, 0x38, 0x03, 0xda, 0x61, 0xa7, 0x4d, 0x2e, 0xe2, 0xc0, 0x25, 0x72, 0x5c,
0xd3, 0x59, 0x73, 0xe3, 0xcc, 0x76, 0x2a, 0x72, 0xe2, 0x7b, 0xf0, 0x21, 0xf8, 0x8c, 0xc8, 0x7f,
0x32, 0xd1, 0x4d, 0xbd, 0xfd, 0xfc, 0x7e, 0x2f, 0x2f, 0xef, 0x3d, 0x1b, 0x4e, 0x55, 0x4b, 0x0b,
0x4d, 0x49, 0xd3, 0x30, 0x55, 0x68, 0xa6, 0xf6, 0x9c, 0xb2, 0xbc, 0x55, 0xd2, 0x48, 0x74, 0x62,
0x14, 0xdf, 0x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