■ ■ ■ ■ ■ ■
proto/plugin_service.proto
| 1 | + | /* |
| 2 | + | * Copyright 2020 Google LLC |
| 3 | + | * |
| 4 | + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + | * you may not use this file except in compliance with the License. |
| 6 | + | * You may obtain a copy of the License at |
| 7 | + | * |
| 8 | + | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + | * |
| 10 | + | * Unless required by applicable law or agreed to in writing, software |
| 11 | + | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + | * See the License for the specific language governing permissions and |
| 14 | + | * limitations under the License. |
| 15 | + | */ |
| 16 | + | |
| 17 | + | // Model for the plugin RPC service protocol. |
| 18 | + | syntax = "proto3"; |
| 19 | + | |
| 20 | + | package tsunami.proto; |
| 21 | + | |
| 22 | + | import "plugin_representation.proto"; |
| 23 | + | import "detection.proto"; |
| 24 | + | import "reconnaissance.proto"; |
| 25 | + | import "network_service.proto"; |
| 26 | + | |
| 27 | + | option java_multiple_files = true; |
| 28 | + | option java_outer_classname = "PluginServiceProtos"; |
| 29 | + | option java_package = "com.google.tsunami.proto"; |
| 30 | + | option go_package = "github.com/google/tsunami-security-scanner/proto"; |
| 31 | + | |
| 32 | + | // Represents a run request with all matched plugins that will need to run |
| 33 | + | // as well as the target to run against. |
| 34 | + | message RunRequest { |
| 35 | + | // Target of the plugins. |
| 36 | + | TargetInfo target = 1; |
| 37 | + | // All matched plugins that will need to run. |
| 38 | + | repeated MatchedPlugin plugins = 2; |
| 39 | + | } |
| 40 | + | |
| 41 | + | // Represents the plugin needed to run by the language-specific server |
| 42 | + | // as well as all the matched network services for the plugin. |
| 43 | + | message MatchedPlugin { |
| 44 | + | // All matched network services from the reconnaissance report. |
| 45 | + | repeated NetworkService services = 1; |
| 46 | + | // Plugin to run. |
| 47 | + | PluginDefinition plugin = 2; |
| 48 | + | } |
| 49 | + | |
| 50 | + | // Represents a run response with the only field being all DetectionReports |
| 51 | + | // generated by the language-specific server. |
| 52 | + | message RunResponse { |
| 53 | + | DetectionReportList reports = 1; |
| 54 | + | } |
| 55 | + | |
| 56 | + | // Represents a request to list all plugins from the requested server. |
| 57 | + | message ListPluginsRequest {} |
| 58 | + | |
| 59 | + | // Represents a response containing a list of all plugins |
| 60 | + | // from the requested server. |
| 61 | + | message ListPluginsResponse { |
| 62 | + | repeated PluginDefinition plugins = 1; |
| 63 | + | } |
| 64 | + | |
| 65 | + | // Represents the plugin service, two RPCs for running plugins |
| 66 | + | // and listing plugins, respectively. |
| 67 | + | service PluginService { |
| 68 | + | // Performs a run request to run all language plugins specified by the request. |
| 69 | + | rpc Run(RunRequest) returns (RunResponse) {} |
| 70 | + | // Sends a request to list all plugins from the respective language server. |
| 71 | + | rpc ListPlugins(ListPluginsRequest) returns (ListPluginsResponse) {} |
| 72 | + | } |
| 73 | + | |