diff --git a/apps/cnspec/cmd/scan.go b/apps/cnspec/cmd/scan.go index a8c2c091..8789d39a 100644 --- a/apps/cnspec/cmd/scan.go +++ b/apps/cnspec/cmd/scan.go @@ -185,6 +185,7 @@ type scanConfig struct { PolicyPaths []string PolicyNames []string Props map[string]string + Annotations map[string]string Bundle *policy.Bundle runtime *providers.Runtime @@ -211,6 +212,20 @@ func getCobraScanConfig(cmd *cobra.Command, runtime *providers.Runtime, cliRes * if err != nil { log.Fatal().Err(err).Msg("failed to parse inventory") } + + annotations, err := cmd.Flags().GetStringToString("annotation") + if err != nil { + log.Fatal().Err(err).Msg("failed to parse annotations") + } + + // merge the config and the user-provided annotations with the latter having precedence + optAnnotations := opts.Annotations + if optAnnotations == nil { + optAnnotations = map[string]string{} + } + for k, v := range annotations { + optAnnotations[k] = v + } conf := scanConfig{ Features: opts.GetFeatures(), IsIncognito: viper.GetBool("incognito"), @@ -220,6 +235,7 @@ func getCobraScanConfig(cmd *cobra.Command, runtime *providers.Runtime, cliRes * ScoreThreshold: viper.GetInt("score-threshold"), Props: props, runtime: runtime, + Annotations: optAnnotations, } // if users want to get more information on available output options, @@ -332,6 +348,7 @@ func RunScan(config *scanConfig, scannerOpts ...scan.ScannerOption) (*policy.Rep Bundle: config.Bundle, PolicyFilters: config.PolicyNames, Props: config.Props, + Annotations: config.Annotations, }) } else { res, err = scanner.Run( @@ -341,6 +358,7 @@ func RunScan(config *scanConfig, scannerOpts ...scan.ScannerOption) (*policy.Rep Bundle: config.Bundle, PolicyFilters: config.PolicyNames, Props: config.Props, + Annotations: config.Annotations, }) } diff --git a/policy/scan/local_scanner.go b/policy/scan/local_scanner.go index 806b4c09..b1f74195 100644 --- a/policy/scan/local_scanner.go +++ b/policy/scan/local_scanner.go @@ -317,6 +317,8 @@ func (s *LocalScanner) distributeJob(job *Job, ctx context.Context, upstream *up justAssets := []*inventory.Asset{} for _, asset := range assets { + // apply all annotations to the assets to be scanned + asset.asset.AddAnnotations(job.GetAnnotations()) asset.asset.KindString = asset.asset.GetPlatform().Kind for k, v := range runtimeLabels { if asset.asset.Labels == nil { diff --git a/policy/scan/scan.pb.go b/policy/scan/scan.pb.go index 2de2febb..1bf74adf 100644 --- a/policy/scan/scan.pb.go +++ b/policy/scan/scan.pb.go @@ -180,6 +180,8 @@ type Job struct { // Vault configuration + credentials query // Report type configuration ReportType ReportType `protobuf:"varint,22,opt,name=report_type,json=reportType,proto3,enum=cnspec.policy.scan.ReportType" json:"report_type,omitempty"` + // annotations that will be applied to all assets in the job + Annotations map[string]string `protobuf:"bytes,24,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Job) Reset() { @@ -256,6 +258,13 @@ func (x *Job) GetReportType() ReportType { return ReportType_FULL } +func (x *Job) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + type AdmissionReviewJob struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -759,7 +768,7 @@ var file_scan_proto_rawDesc = []byte{ 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2f, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0xef, 0x02, 0x0a, 0x03, 0x4a, 0x6f, 0x62, 0x12, 0x3d, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, + 0xfb, 0x03, 0x0a, 0x03, 0x4a, 0x6f, 0x62, 0x12, 0x3d, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x09, 0x69, 0x6e, 0x76, @@ -778,143 +787,151 @@ var file_scan_proto_rawDesc = []byte{ 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0xd3, 0x03, 0x0a, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x76, 0x69, 0x65, 0x77, 0x4a, 0x6f, 0x62, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x4a, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4a, 0x6f, 0x62, 0x2e, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x12, 0x3f, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x4d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4a, 0x6f, 0x62, 0x2e, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x09, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3a, 0x0a, 0x0c, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, + 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, + 0x6e, 0x2e, 0x4a, 0x6f, 0x62, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, + 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd3, 0x03, + 0x0a, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, + 0x77, 0x4a, 0x6f, 0x62, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x4a, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4a, 0x6f, 0x62, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x3f, 0x0a, + 0x0b, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4d, + 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x33, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, + 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x76, 0x69, 0x65, 0x77, 0x4a, 0x6f, 0x62, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3d, 0x0a, + 0x09, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x79, 0x52, 0x09, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x1a, 0x39, 0x0a, 0x0b, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8a, 0x02, 0x0a, 0x15, 0x47, 0x61, 0x72, 0x62, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3a, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x8a, 0x02, 0x0a, 0x15, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, + 0x0a, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x54, 0x68, 0x61, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x42, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, + 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x61, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x54, 0x68, 0x61, 0x6e, - 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x42, 0x79, 0x12, - 0x29, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x72, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x6e, 0x73, - 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, - 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1a, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x22, 0x89, 0x02, 0x0a, 0x0a, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, - 0x37, 0x0a, 0x0a, 0x77, 0x6f, 0x72, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x52, 0x0a, 0x77, 0x6f, - 0x72, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x12, 0x38, 0x0a, 0x04, 0x66, 0x75, 0x6c, 0x6c, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x04, 0x66, 0x75, - 0x6c, 0x6c, 0x12, 0x3d, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x73, 0x12, 0x2f, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, - 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x6f, - 0x6e, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x95, 0x01, 0x0a, - 0x0f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x47, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2f, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2e, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x22, 0x99, 0x02, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x63, - 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, - 0x6e, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x14, 0x0a, 0x05, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x4f, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, - 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, - 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, - 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x03, - 0x2a, 0x2b, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, - 0x0a, 0x04, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x32, 0xf7, 0x03, - 0x0a, 0x04, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x40, 0x0a, 0x03, 0x52, 0x75, 0x6e, 0x12, 0x17, 0x2e, - 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, - 0x61, 0x6e, 0x2e, 0x4a, 0x6f, 0x62, 0x1a, 0x1e, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x53, 0x63, 0x61, 0x6e, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0c, 0x52, 0x75, 0x6e, 0x49, - 0x6e, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x74, 0x6f, 0x12, 0x17, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, - 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x4a, 0x6f, - 0x62, 0x1a, 0x1e, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, + 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x1a, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x89, 0x02, 0x0a, + 0x0a, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x0a, 0x77, + 0x6f, 0x72, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, - 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x4a, 0x6f, 0x62, 0x1a, 0x19, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, - 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x12, 0x52, 0x75, 0x6e, 0x41, 0x64, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x26, 0x2e, 0x63, 0x6e, + 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x73, 0x74, 0x53, + 0x63, 0x6f, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x02, 0x6f, 0x6b, 0x12, 0x38, 0x0a, 0x04, 0x66, 0x75, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x04, 0x66, 0x75, 0x6c, 0x6c, 0x12, 0x3d, + 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, + 0x63, 0x61, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x2f, 0x0a, + 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, - 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, - 0x4a, 0x6f, 0x62, 0x1a, 0x1e, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x14, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, - 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x29, 0x2e, - 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, - 0x61, 0x6e, 0x2e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, - 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x19, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, - 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x12, 0x26, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x42, 0x08, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x06, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, - 0x6e, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x6d, 0x6f, - 0x6e, 0x64, 0x6f, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2f, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2f, 0x73, 0x63, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x2e, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x22, 0x99, 0x02, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, + 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x48, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, + 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x4f, 0x0a, 0x0d, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, + 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, + 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, + 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x52, 0x56, 0x49, + 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x2a, 0x2b, 0x0a, 0x0a, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x55, + 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, + 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x32, 0xf7, 0x03, 0x0a, 0x04, 0x53, 0x63, + 0x61, 0x6e, 0x12, 0x40, 0x0a, 0x03, 0x52, 0x75, 0x6e, 0x12, 0x17, 0x2e, 0x63, 0x6e, 0x73, 0x70, + 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x4a, + 0x6f, 0x62, 0x1a, 0x1e, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0c, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x63, 0x6f, 0x67, + 0x6e, 0x69, 0x74, 0x6f, 0x12, 0x17, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x4a, 0x6f, 0x62, 0x1a, 0x1e, 0x2e, + 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, + 0x61, 0x6e, 0x2e, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, + 0x40, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x63, 0x6e, + 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, + 0x2e, 0x4a, 0x6f, 0x62, 0x1a, 0x19, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x00, 0x12, 0x5e, 0x0a, 0x12, 0x52, 0x75, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x26, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, + 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x41, 0x64, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4a, 0x6f, 0x62, 0x1a, + 0x1e, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, + 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0x00, 0x12, 0x5e, 0x0a, 0x14, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x6e, 0x73, 0x70, + 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x47, + 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x19, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x00, 0x12, 0x60, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x12, 0x26, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6e, 0x73, 0x70, 0x65, + 0x63, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x73, 0x63, 0x61, 0x6e, 0x2e, 0x48, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x6d, 0x6f, 0x6e, 0x64, 0x6f, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x2f, 0x73, 0x63, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -930,7 +947,7 @@ func file_scan_proto_rawDescGZIP() []byte { } var file_scan_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_scan_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_scan_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_scan_proto_goTypes = []interface{}{ (ReportType)(0), // 0: cnspec.policy.scan.ReportType (HealthCheckResponse_ServingStatus)(0), // 1: cnspec.policy.scan.HealthCheckResponse.ServingStatus @@ -944,51 +961,53 @@ var file_scan_proto_goTypes = []interface{}{ (*HealthCheckRequest)(nil), // 9: cnspec.policy.scan.HealthCheckRequest (*HealthCheckResponse)(nil), // 10: cnspec.policy.scan.HealthCheckResponse nil, // 11: cnspec.policy.scan.Job.PropsEntry - nil, // 12: cnspec.policy.scan.AdmissionReviewJob.LabelsEntry - nil, // 13: cnspec.policy.scan.AdmissionReviewJob.OptionsEntry - nil, // 14: cnspec.policy.scan.GarbageCollectOptions.LabelsEntry - nil, // 15: cnspec.policy.scan.ErrorCollection.ErrorsEntry - (*inventory.Inventory)(nil), // 16: cnquery.providers.v1.Inventory - (*policy.Bundle)(nil), // 17: cnspec.policy.v1.Bundle - (*structpb.Struct)(nil), // 18: google.protobuf.Struct - (*inventory.Discovery)(nil), // 19: cnquery.providers.v1.Discovery - (*policy.Score)(nil), // 20: cnspec.policy.v1.Score - (*policy.ReportCollection)(nil), // 21: cnspec.policy.v1.ReportCollection + nil, // 12: cnspec.policy.scan.Job.AnnotationsEntry + nil, // 13: cnspec.policy.scan.AdmissionReviewJob.LabelsEntry + nil, // 14: cnspec.policy.scan.AdmissionReviewJob.OptionsEntry + nil, // 15: cnspec.policy.scan.GarbageCollectOptions.LabelsEntry + nil, // 16: cnspec.policy.scan.ErrorCollection.ErrorsEntry + (*inventory.Inventory)(nil), // 17: cnquery.providers.v1.Inventory + (*policy.Bundle)(nil), // 18: cnspec.policy.v1.Bundle + (*structpb.Struct)(nil), // 19: google.protobuf.Struct + (*inventory.Discovery)(nil), // 20: cnquery.providers.v1.Discovery + (*policy.Score)(nil), // 21: cnspec.policy.v1.Score + (*policy.ReportCollection)(nil), // 22: cnspec.policy.v1.ReportCollection } var file_scan_proto_depIdxs = []int32{ - 16, // 0: cnspec.policy.scan.Job.inventory:type_name -> cnquery.providers.v1.Inventory - 17, // 1: cnspec.policy.scan.Job.bundle:type_name -> cnspec.policy.v1.Bundle + 17, // 0: cnspec.policy.scan.Job.inventory:type_name -> cnquery.providers.v1.Inventory + 18, // 1: cnspec.policy.scan.Job.bundle:type_name -> cnspec.policy.v1.Bundle 11, // 2: cnspec.policy.scan.Job.props:type_name -> cnspec.policy.scan.Job.PropsEntry 0, // 3: cnspec.policy.scan.Job.report_type:type_name -> cnspec.policy.scan.ReportType - 18, // 4: cnspec.policy.scan.AdmissionReviewJob.data:type_name -> google.protobuf.Struct - 12, // 5: cnspec.policy.scan.AdmissionReviewJob.labels:type_name -> cnspec.policy.scan.AdmissionReviewJob.LabelsEntry - 0, // 6: cnspec.policy.scan.AdmissionReviewJob.report_type:type_name -> cnspec.policy.scan.ReportType - 13, // 7: cnspec.policy.scan.AdmissionReviewJob.options:type_name -> cnspec.policy.scan.AdmissionReviewJob.OptionsEntry - 19, // 8: cnspec.policy.scan.AdmissionReviewJob.discovery:type_name -> cnquery.providers.v1.Discovery - 14, // 9: cnspec.policy.scan.GarbageCollectOptions.labels:type_name -> cnspec.policy.scan.GarbageCollectOptions.LabelsEntry - 20, // 10: cnspec.policy.scan.ScanResult.worstScore:type_name -> cnspec.policy.v1.Score - 21, // 11: cnspec.policy.scan.ScanResult.full:type_name -> cnspec.policy.v1.ReportCollection - 8, // 12: cnspec.policy.scan.ScanResult.errors:type_name -> cnspec.policy.scan.ErrorCollection - 2, // 13: cnspec.policy.scan.ScanResult.none:type_name -> cnspec.policy.scan.Empty - 15, // 14: cnspec.policy.scan.ErrorCollection.errors:type_name -> cnspec.policy.scan.ErrorCollection.ErrorsEntry - 1, // 15: cnspec.policy.scan.HealthCheckResponse.status:type_name -> cnspec.policy.scan.HealthCheckResponse.ServingStatus - 3, // 16: cnspec.policy.scan.Scan.Run:input_type -> cnspec.policy.scan.Job - 3, // 17: cnspec.policy.scan.Scan.RunIncognito:input_type -> cnspec.policy.scan.Job - 3, // 18: cnspec.policy.scan.Scan.Schedule:input_type -> cnspec.policy.scan.Job - 4, // 19: cnspec.policy.scan.Scan.RunAdmissionReview:input_type -> cnspec.policy.scan.AdmissionReviewJob - 5, // 20: cnspec.policy.scan.Scan.GarbageCollectAssets:input_type -> cnspec.policy.scan.GarbageCollectOptions - 9, // 21: cnspec.policy.scan.Scan.HealthCheck:input_type -> cnspec.policy.scan.HealthCheckRequest - 7, // 22: cnspec.policy.scan.Scan.Run:output_type -> cnspec.policy.scan.ScanResult - 7, // 23: cnspec.policy.scan.Scan.RunIncognito:output_type -> cnspec.policy.scan.ScanResult - 2, // 24: cnspec.policy.scan.Scan.Schedule:output_type -> cnspec.policy.scan.Empty - 7, // 25: cnspec.policy.scan.Scan.RunAdmissionReview:output_type -> cnspec.policy.scan.ScanResult - 2, // 26: cnspec.policy.scan.Scan.GarbageCollectAssets:output_type -> cnspec.policy.scan.Empty - 10, // 27: cnspec.policy.scan.Scan.HealthCheck:output_type -> cnspec.policy.scan.HealthCheckResponse - 22, // [22:28] is the sub-list for method output_type - 16, // [16:22] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 12, // 4: cnspec.policy.scan.Job.annotations:type_name -> cnspec.policy.scan.Job.AnnotationsEntry + 19, // 5: cnspec.policy.scan.AdmissionReviewJob.data:type_name -> google.protobuf.Struct + 13, // 6: cnspec.policy.scan.AdmissionReviewJob.labels:type_name -> cnspec.policy.scan.AdmissionReviewJob.LabelsEntry + 0, // 7: cnspec.policy.scan.AdmissionReviewJob.report_type:type_name -> cnspec.policy.scan.ReportType + 14, // 8: cnspec.policy.scan.AdmissionReviewJob.options:type_name -> cnspec.policy.scan.AdmissionReviewJob.OptionsEntry + 20, // 9: cnspec.policy.scan.AdmissionReviewJob.discovery:type_name -> cnquery.providers.v1.Discovery + 15, // 10: cnspec.policy.scan.GarbageCollectOptions.labels:type_name -> cnspec.policy.scan.GarbageCollectOptions.LabelsEntry + 21, // 11: cnspec.policy.scan.ScanResult.worstScore:type_name -> cnspec.policy.v1.Score + 22, // 12: cnspec.policy.scan.ScanResult.full:type_name -> cnspec.policy.v1.ReportCollection + 8, // 13: cnspec.policy.scan.ScanResult.errors:type_name -> cnspec.policy.scan.ErrorCollection + 2, // 14: cnspec.policy.scan.ScanResult.none:type_name -> cnspec.policy.scan.Empty + 16, // 15: cnspec.policy.scan.ErrorCollection.errors:type_name -> cnspec.policy.scan.ErrorCollection.ErrorsEntry + 1, // 16: cnspec.policy.scan.HealthCheckResponse.status:type_name -> cnspec.policy.scan.HealthCheckResponse.ServingStatus + 3, // 17: cnspec.policy.scan.Scan.Run:input_type -> cnspec.policy.scan.Job + 3, // 18: cnspec.policy.scan.Scan.RunIncognito:input_type -> cnspec.policy.scan.Job + 3, // 19: cnspec.policy.scan.Scan.Schedule:input_type -> cnspec.policy.scan.Job + 4, // 20: cnspec.policy.scan.Scan.RunAdmissionReview:input_type -> cnspec.policy.scan.AdmissionReviewJob + 5, // 21: cnspec.policy.scan.Scan.GarbageCollectAssets:input_type -> cnspec.policy.scan.GarbageCollectOptions + 9, // 22: cnspec.policy.scan.Scan.HealthCheck:input_type -> cnspec.policy.scan.HealthCheckRequest + 7, // 23: cnspec.policy.scan.Scan.Run:output_type -> cnspec.policy.scan.ScanResult + 7, // 24: cnspec.policy.scan.Scan.RunIncognito:output_type -> cnspec.policy.scan.ScanResult + 2, // 25: cnspec.policy.scan.Scan.Schedule:output_type -> cnspec.policy.scan.Empty + 7, // 26: cnspec.policy.scan.Scan.RunAdmissionReview:output_type -> cnspec.policy.scan.ScanResult + 2, // 27: cnspec.policy.scan.Scan.GarbageCollectAssets:output_type -> cnspec.policy.scan.Empty + 10, // 28: cnspec.policy.scan.Scan.HealthCheck:output_type -> cnspec.policy.scan.HealthCheckResponse + 23, // [23:29] is the sub-list for method output_type + 17, // [17:23] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_scan_proto_init() } @@ -1117,7 +1136,7 @@ func file_scan_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_scan_proto_rawDesc, NumEnums: 2, - NumMessages: 14, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/policy/scan/scan.proto b/policy/scan/scan.proto index db3c4153..ae33e848 100644 --- a/policy/scan/scan.proto +++ b/policy/scan/scan.proto @@ -50,6 +50,9 @@ message Job { // Vault configuration + credentials query // Report type configuration ReportType report_type = 22; + + // annotations that will be applied to all assets in the job + map annotations = 24; } message AdmissionReviewJob {