scan_run.proto 3.5 KB

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