scan_run.proto 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // Copyright 2019 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. //
  15. syntax = "proto3";
  16. package google.cloud.websecurityscanner.v1beta;
  17. import "google/api/resource.proto";
  18. import "google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto";
  19. import "google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "ScanRunProto";
  25. option java_package = "com.google.cloud.websecurityscanner.v1beta";
  26. option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta";
  27. option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta";
  28. // A ScanRun is a output-only resource representing an actual run of the scan.
  29. // Next id: 12
  30. message ScanRun {
  31. option (google.api.resource) = {
  32. type: "websecurityscanner.googleapis.com/ScanRun"
  33. pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}"
  34. };
  35. // Types of ScanRun execution state.
  36. enum ExecutionState {
  37. // Represents an invalid state caused by internal server error. This value
  38. // should never be returned.
  39. EXECUTION_STATE_UNSPECIFIED = 0;
  40. // The scan is waiting in the queue.
  41. QUEUED = 1;
  42. // The scan is in progress.
  43. SCANNING = 2;
  44. // The scan is either finished or stopped by user.
  45. FINISHED = 3;
  46. }
  47. // Types of ScanRun result state.
  48. enum ResultState {
  49. // Default value. This value is returned when the ScanRun is not yet
  50. // finished.
  51. RESULT_STATE_UNSPECIFIED = 0;
  52. // The scan finished without errors.
  53. SUCCESS = 1;
  54. // The scan finished with errors.
  55. ERROR = 2;
  56. // The scan was terminated by user.
  57. KILLED = 3;
  58. }
  59. // The resource name of the ScanRun. The name follows the format of
  60. // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  61. // The ScanRun IDs are generated by the system.
  62. string name = 1;
  63. // The execution state of the ScanRun.
  64. ExecutionState execution_state = 2;
  65. // The result state of the ScanRun. This field is only available after the
  66. // execution state reaches "FINISHED".
  67. ResultState result_state = 3;
  68. // The time at which the ScanRun started.
  69. google.protobuf.Timestamp start_time = 4;
  70. // The time at which the ScanRun reached termination state - that the ScanRun
  71. // is either finished or stopped by user.
  72. google.protobuf.Timestamp end_time = 5;
  73. // The number of URLs crawled during this ScanRun. If the scan is in progress,
  74. // the value represents the number of URLs crawled up to now.
  75. int64 urls_crawled_count = 6;
  76. // The number of URLs tested during this ScanRun. If the scan is in progress,
  77. // the value represents the number of URLs tested up to now. The number of
  78. // URLs tested is usually larger than the number URLS crawled because
  79. // typically a crawled URL is tested with multiple test payloads.
  80. int64 urls_tested_count = 7;
  81. // Whether the scan run has found any vulnerabilities.
  82. bool has_vulnerabilities = 8;
  83. // The percentage of total completion ranging from 0 to 100.
  84. // If the scan is in queue, the value is 0.
  85. // If the scan is running, the value ranges from 0 to 100.
  86. // If the scan is finished, the value is 100.
  87. int32 progress_percent = 9;
  88. // If result_state is an ERROR, this field provides the primary reason for
  89. // scan's termination and more details, if such are available.
  90. ScanRunErrorTrace error_trace = 10;
  91. // A list of warnings, if such are encountered during this scan run.
  92. repeated ScanRunWarningTrace warning_traces = 11;
  93. }