scan_config.proto 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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/field_behavior.proto";
  18. import "google/api/resource.proto";
  19. import "google/cloud/websecurityscanner/v1alpha/scan_run.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ScanConfigProto";
  24. option java_package = "com.google.cloud.websecurityscanner.v1alpha";
  25. // A ScanConfig resource contains the configurations to launch a scan.
  26. // next id: 12
  27. message ScanConfig {
  28. option (google.api.resource) = {
  29. type: "websecurityscanner.googleapis.com/ScanConfig"
  30. pattern: "projects/{project}/scanConfigs/{scan_config}"
  31. };
  32. // Scan authentication configuration.
  33. message Authentication {
  34. // Describes authentication configuration that uses a Google account.
  35. message GoogleAccount {
  36. // Required. The user name of the Google account.
  37. string username = 1 [(google.api.field_behavior) = REQUIRED];
  38. // Required. Input only. The password of the Google account. The credential is stored encrypted
  39. // and not returned in any response nor included in audit logs.
  40. string password = 2 [
  41. (google.api.field_behavior) = REQUIRED,
  42. (google.api.field_behavior) = INPUT_ONLY
  43. ];
  44. }
  45. // Describes authentication configuration that uses a custom account.
  46. message CustomAccount {
  47. // Required. The user name of the custom account.
  48. string username = 1 [(google.api.field_behavior) = REQUIRED];
  49. // Required. Input only. The password of the custom account. The credential is stored encrypted
  50. // and not returned in any response nor included in audit logs.
  51. string password = 2 [
  52. (google.api.field_behavior) = REQUIRED,
  53. (google.api.field_behavior) = INPUT_ONLY
  54. ];
  55. // Required. The login form URL of the website.
  56. string login_url = 3 [(google.api.field_behavior) = REQUIRED];
  57. }
  58. // Required.
  59. // Authentication configuration
  60. oneof authentication {
  61. // Authentication using a Google account.
  62. GoogleAccount google_account = 1;
  63. // Authentication using a custom account.
  64. CustomAccount custom_account = 2;
  65. }
  66. }
  67. // Scan schedule configuration.
  68. message Schedule {
  69. // A timestamp indicates when the next run will be scheduled. The value is
  70. // refreshed by the server after each run. If unspecified, it will default
  71. // to current server time, which means the scan will be scheduled to start
  72. // immediately.
  73. google.protobuf.Timestamp schedule_time = 1;
  74. // Required. The duration of time between executions in days.
  75. int32 interval_duration_days = 2 [(google.api.field_behavior) = REQUIRED];
  76. }
  77. // Type of user agents used for scanning.
  78. enum UserAgent {
  79. // The user agent is unknown. Service will default to CHROME_LINUX.
  80. USER_AGENT_UNSPECIFIED = 0;
  81. // Chrome on Linux. This is the service default if unspecified.
  82. CHROME_LINUX = 1;
  83. // Chrome on Android.
  84. CHROME_ANDROID = 2;
  85. // Safari on IPhone.
  86. SAFARI_IPHONE = 3;
  87. }
  88. // Cloud platforms supported by Cloud Web Security Scanner.
  89. enum TargetPlatform {
  90. // The target platform is unknown. Requests with this enum value will be
  91. // rejected with INVALID_ARGUMENT error.
  92. TARGET_PLATFORM_UNSPECIFIED = 0;
  93. // Google App Engine service.
  94. APP_ENGINE = 1;
  95. // Google Compute Engine service.
  96. COMPUTE = 2;
  97. }
  98. // The resource name of the ScanConfig. The name follows the format of
  99. // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
  100. // generated by the system.
  101. string name = 1;
  102. // Required. The user provided display name of the ScanConfig.
  103. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  104. // The maximum QPS during scanning. A valid value ranges from 5 to 20
  105. // inclusively. If the field is unspecified or its value is set 0, server will
  106. // default to 15. Other values outside of [5, 20] range will be rejected with
  107. // INVALID_ARGUMENT error.
  108. int32 max_qps = 3;
  109. // Required. The starting URLs from which the scanner finds site pages.
  110. repeated string starting_urls = 4 [(google.api.field_behavior) = REQUIRED];
  111. // The authentication configuration. If specified, service will use the
  112. // authentication configuration during scanning.
  113. Authentication authentication = 5;
  114. // The user agent used during scanning.
  115. UserAgent user_agent = 6;
  116. // The blacklist URL patterns as described in
  117. // https://cloud.google.com/security-scanner/docs/excluded-urls
  118. repeated string blacklist_patterns = 7;
  119. // The schedule of the ScanConfig.
  120. Schedule schedule = 8;
  121. // Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be
  122. // used as a default.
  123. repeated TargetPlatform target_platforms = 9;
  124. // Latest ScanRun if available.
  125. ScanRun latest_run = 11;
  126. }