web_security_scanner.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.websecurityscanner.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/cloud/websecurityscanner/v1/crawled_url.proto";
  19. import "google/cloud/websecurityscanner/v1/finding.proto";
  20. import "google/cloud/websecurityscanner/v1/finding_type_stats.proto";
  21. import "google/cloud/websecurityscanner/v1/scan_config.proto";
  22. import "google/cloud/websecurityscanner/v1/scan_run.proto";
  23. import "google/protobuf/empty.proto";
  24. import "google/protobuf/field_mask.proto";
  25. option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1";
  26. option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "WebSecurityScannerProto";
  29. option java_package = "com.google.cloud.websecurityscanner.v1";
  30. option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1";
  31. option ruby_package = "Google::Cloud::WebSecurityScanner::V1";
  32. // Web Security Scanner Service identifies security vulnerabilities in web
  33. // applications hosted on Google Cloud. It crawls your application, and
  34. // attempts to exercise as many user inputs and event handlers as possible.
  35. service WebSecurityScanner {
  36. option (google.api.default_host) = "websecurityscanner.googleapis.com";
  37. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  38. // Creates a new ScanConfig.
  39. rpc CreateScanConfig(CreateScanConfigRequest) returns (ScanConfig) {
  40. option (google.api.http) = {
  41. post: "/v1/{parent=projects/*}/scanConfigs"
  42. body: "scan_config"
  43. };
  44. }
  45. // Deletes an existing ScanConfig and its child resources.
  46. rpc DeleteScanConfig(DeleteScanConfigRequest) returns (google.protobuf.Empty) {
  47. option (google.api.http) = {
  48. delete: "/v1/{name=projects/*/scanConfigs/*}"
  49. };
  50. }
  51. // Gets a ScanConfig.
  52. rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) {
  53. option (google.api.http) = {
  54. get: "/v1/{name=projects/*/scanConfigs/*}"
  55. };
  56. }
  57. // Lists ScanConfigs under a given project.
  58. rpc ListScanConfigs(ListScanConfigsRequest) returns (ListScanConfigsResponse) {
  59. option (google.api.http) = {
  60. get: "/v1/{parent=projects/*}/scanConfigs"
  61. };
  62. }
  63. // Updates a ScanConfig. This method support partial update of a ScanConfig.
  64. rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) {
  65. option (google.api.http) = {
  66. patch: "/v1/{scan_config.name=projects/*/scanConfigs/*}"
  67. body: "scan_config"
  68. };
  69. }
  70. // Start a ScanRun according to the given ScanConfig.
  71. rpc StartScanRun(StartScanRunRequest) returns (ScanRun) {
  72. option (google.api.http) = {
  73. post: "/v1/{name=projects/*/scanConfigs/*}:start"
  74. body: "*"
  75. };
  76. }
  77. // Gets a ScanRun.
  78. rpc GetScanRun(GetScanRunRequest) returns (ScanRun) {
  79. option (google.api.http) = {
  80. get: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}"
  81. };
  82. }
  83. // Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
  84. // stop time.
  85. rpc ListScanRuns(ListScanRunsRequest) returns (ListScanRunsResponse) {
  86. option (google.api.http) = {
  87. get: "/v1/{parent=projects/*/scanConfigs/*}/scanRuns"
  88. };
  89. }
  90. // Stops a ScanRun. The stopped ScanRun is returned.
  91. rpc StopScanRun(StopScanRunRequest) returns (ScanRun) {
  92. option (google.api.http) = {
  93. post: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}:stop"
  94. body: "*"
  95. };
  96. }
  97. // List CrawledUrls under a given ScanRun.
  98. rpc ListCrawledUrls(ListCrawledUrlsRequest) returns (ListCrawledUrlsResponse) {
  99. option (google.api.http) = {
  100. get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls"
  101. };
  102. }
  103. // Gets a Finding.
  104. rpc GetFinding(GetFindingRequest) returns (Finding) {
  105. option (google.api.http) = {
  106. get: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}"
  107. };
  108. }
  109. // List Findings under a given ScanRun.
  110. rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) {
  111. option (google.api.http) = {
  112. get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings"
  113. };
  114. }
  115. // List all FindingTypeStats under a given ScanRun.
  116. rpc ListFindingTypeStats(ListFindingTypeStatsRequest) returns (ListFindingTypeStatsResponse) {
  117. option (google.api.http) = {
  118. get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats"
  119. };
  120. }
  121. }
  122. // Request for the `CreateScanConfig` method.
  123. message CreateScanConfigRequest {
  124. // Required. The parent resource name where the scan is created, which should be a
  125. // project resource name in the format 'projects/{projectId}'.
  126. string parent = 1;
  127. // Required. The ScanConfig to be created.
  128. ScanConfig scan_config = 2;
  129. }
  130. // Request for the `DeleteScanConfig` method.
  131. message DeleteScanConfigRequest {
  132. // Required. The resource name of the ScanConfig to be deleted. The name follows the
  133. // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  134. string name = 1;
  135. }
  136. // Request for the `GetScanConfig` method.
  137. message GetScanConfigRequest {
  138. // Required. The resource name of the ScanConfig to be returned. The name follows the
  139. // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  140. string name = 1;
  141. }
  142. // Request for the `ListScanConfigs` method.
  143. message ListScanConfigsRequest {
  144. // Required. The parent resource name, which should be a project resource name in the
  145. // format 'projects/{projectId}'.
  146. string parent = 1;
  147. // A token identifying a page of results to be returned. This should be a
  148. // `next_page_token` value returned from a previous List request.
  149. // If unspecified, the first page of results is returned.
  150. string page_token = 2;
  151. // The maximum number of ScanConfigs to return, can be limited by server.
  152. // If not specified or not positive, the implementation will select a
  153. // reasonable value.
  154. int32 page_size = 3;
  155. }
  156. // Request for the `UpdateScanConfigRequest` method.
  157. message UpdateScanConfigRequest {
  158. // Required. The ScanConfig to be updated. The name field must be set to identify the
  159. // resource to be updated. The values of fields not covered by the mask
  160. // will be ignored.
  161. ScanConfig scan_config = 2;
  162. // Required. The update mask applies to the resource. For the `FieldMask` definition,
  163. // see
  164. // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  165. google.protobuf.FieldMask update_mask = 3;
  166. }
  167. // Response for the `ListScanConfigs` method.
  168. message ListScanConfigsResponse {
  169. // The list of ScanConfigs returned.
  170. repeated ScanConfig scan_configs = 1;
  171. // Token to retrieve the next page of results, or empty if there are no
  172. // more results in the list.
  173. string next_page_token = 2;
  174. }
  175. // Request for the `StartScanRun` method.
  176. message StartScanRunRequest {
  177. // Required. The resource name of the ScanConfig to be used. The name follows the
  178. // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  179. string name = 1;
  180. }
  181. // Request for the `GetScanRun` method.
  182. message GetScanRunRequest {
  183. // Required. The resource name of the ScanRun to be returned. The name follows the
  184. // format of
  185. // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  186. string name = 1;
  187. }
  188. // Request for the `ListScanRuns` method.
  189. message ListScanRunsRequest {
  190. // Required. The parent resource name, which should be a scan resource name in the
  191. // format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  192. string parent = 1;
  193. // A token identifying a page of results to be returned. This should be a
  194. // `next_page_token` value returned from a previous List request.
  195. // If unspecified, the first page of results is returned.
  196. string page_token = 2;
  197. // The maximum number of ScanRuns to return, can be limited by server.
  198. // If not specified or not positive, the implementation will select a
  199. // reasonable value.
  200. int32 page_size = 3;
  201. }
  202. // Response for the `ListScanRuns` method.
  203. message ListScanRunsResponse {
  204. // The list of ScanRuns returned.
  205. repeated ScanRun scan_runs = 1;
  206. // Token to retrieve the next page of results, or empty if there are no
  207. // more results in the list.
  208. string next_page_token = 2;
  209. }
  210. // Request for the `StopScanRun` method.
  211. message StopScanRunRequest {
  212. // Required. The resource name of the ScanRun to be stopped. The name follows the
  213. // format of
  214. // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  215. string name = 1;
  216. }
  217. // Request for the `ListCrawledUrls` method.
  218. message ListCrawledUrlsRequest {
  219. // Required. The parent resource name, which should be a scan run resource name in the
  220. // format
  221. // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  222. string parent = 1;
  223. // A token identifying a page of results to be returned. This should be a
  224. // `next_page_token` value returned from a previous List request.
  225. // If unspecified, the first page of results is returned.
  226. string page_token = 2;
  227. // The maximum number of CrawledUrls to return, can be limited by server.
  228. // If not specified or not positive, the implementation will select a
  229. // reasonable value.
  230. int32 page_size = 3;
  231. }
  232. // Response for the `ListCrawledUrls` method.
  233. message ListCrawledUrlsResponse {
  234. // The list of CrawledUrls returned.
  235. repeated CrawledUrl crawled_urls = 1;
  236. // Token to retrieve the next page of results, or empty if there are no
  237. // more results in the list.
  238. string next_page_token = 2;
  239. }
  240. // Request for the `GetFinding` method.
  241. message GetFindingRequest {
  242. // Required. The resource name of the Finding to be returned. The name follows the
  243. // format of
  244. // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
  245. string name = 1;
  246. }
  247. // Request for the `ListFindings` method.
  248. message ListFindingsRequest {
  249. // Required. The parent resource name, which should be a scan run resource name in the
  250. // format
  251. // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  252. string parent = 1;
  253. // The filter expression. The expression must be in the format: <field>
  254. // <operator> <value>.
  255. // Supported field: 'finding_type'.
  256. // Supported operator: '='.
  257. string filter = 2;
  258. // A token identifying a page of results to be returned. This should be a
  259. // `next_page_token` value returned from a previous List request.
  260. // If unspecified, the first page of results is returned.
  261. string page_token = 3;
  262. // The maximum number of Findings to return, can be limited by server.
  263. // If not specified or not positive, the implementation will select a
  264. // reasonable value.
  265. int32 page_size = 4;
  266. }
  267. // Response for the `ListFindings` method.
  268. message ListFindingsResponse {
  269. // The list of Findings returned.
  270. repeated Finding findings = 1;
  271. // Token to retrieve the next page of results, or empty if there are no
  272. // more results in the list.
  273. string next_page_token = 2;
  274. }
  275. // Request for the `ListFindingTypeStats` method.
  276. message ListFindingTypeStatsRequest {
  277. // Required. The parent resource name, which should be a scan run resource name in the
  278. // format
  279. // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  280. string parent = 1;
  281. }
  282. // Response for the `ListFindingTypeStats` method.
  283. message ListFindingTypeStatsResponse {
  284. // The list of FindingTypeStats returned.
  285. repeated FindingTypeStats finding_type_stats = 1;
  286. }