google-cloud-web_security_scanner-v1beta 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-web_security_scanner-v1beta.rb +21 -0
  7. data/lib/google/cloud/web_security_scanner/v1beta.rb +35 -0
  8. data/lib/google/cloud/web_security_scanner/v1beta/version.rb +28 -0
  9. data/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner.rb +51 -0
  10. data/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/client.rb +1395 -0
  11. data/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials.rb +51 -0
  12. data/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb +104 -0
  13. data/lib/google/cloud/websecurityscanner/v1beta/crawled_url_pb.rb +24 -0
  14. data/lib/google/cloud/websecurityscanner/v1beta/finding_addon_pb.rb +53 -0
  15. data/lib/google/cloud/websecurityscanner/v1beta/finding_pb.rb +39 -0
  16. data/lib/google/cloud/websecurityscanner/v1beta/finding_type_stats_pb.rb +23 -0
  17. data/lib/google/cloud/websecurityscanner/v1beta/scan_config_error_pb.rb +68 -0
  18. data/lib/google/cloud/websecurityscanner/v1beta/scan_config_pb.rb +85 -0
  19. data/lib/google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb.rb +35 -0
  20. data/lib/google/cloud/websecurityscanner/v1beta/scan_run_pb.rb +50 -0
  21. data/lib/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb.rb +30 -0
  22. data/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb +116 -0
  23. data/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb +73 -0
  24. data/proto_docs/README.md +4 -0
  25. data/proto_docs/google/api/field_behavior.rb +59 -0
  26. data/proto_docs/google/api/resource.rb +283 -0
  27. data/proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb +44 -0
  28. data/proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb +93 -0
  29. data/proto_docs/google/cloud/websecurityscanner/v1beta/finding_addon.rb +111 -0
  30. data/proto_docs/google/cloud/websecurityscanner/v1beta/finding_type_stats.rb +39 -0
  31. data/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config.rb +188 -0
  32. data/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config_error.rb +191 -0
  33. data/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run.rb +110 -0
  34. data/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb +77 -0
  35. data/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.rb +62 -0
  36. data/proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb +278 -0
  37. data/proto_docs/google/protobuf/empty.rb +36 -0
  38. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  39. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  40. metadata +221 -0
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module WebSecurityScanner
23
+ module V1beta
24
+ # A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web
25
+ # Security Scanner Service crawls the web applications, following all links
26
+ # within the scope of sites, to find the URLs to test against.
27
+ # @!attribute [rw] http_method
28
+ # @return [::String]
29
+ # The http method of the request that was used to visit the URL, in
30
+ # uppercase.
31
+ # @!attribute [rw] url
32
+ # @return [::String]
33
+ # The URL that was crawled.
34
+ # @!attribute [rw] body
35
+ # @return [::String]
36
+ # The body of the request that was used to visit the URL.
37
+ class CrawledUrl
38
+ include ::Google::Protobuf::MessageExts
39
+ extend ::Google::Protobuf::MessageExts::ClassMethods
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module WebSecurityScanner
23
+ module V1beta
24
+ # A Finding resource represents a vulnerability instance identified during a
25
+ # ScanRun.
26
+ # @!attribute [rw] name
27
+ # @return [::String]
28
+ # The resource name of the Finding. The name follows the format of
29
+ # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanruns/\\{scanRunId}/findings/\\{findingId}'.
30
+ # The finding IDs are generated by the system.
31
+ # @!attribute [rw] finding_type
32
+ # @return [::String]
33
+ # The type of the Finding.
34
+ # Detailed and up-to-date information on findings can be found here:
35
+ # https://cloud.google.com/security-scanner/docs/scan-result-details
36
+ # @!attribute [rw] http_method
37
+ # @return [::String]
38
+ # The http method of the request that triggered the vulnerability, in
39
+ # uppercase.
40
+ # @!attribute [rw] fuzzed_url
41
+ # @return [::String]
42
+ # The URL produced by the server-side fuzzer and used in the request that
43
+ # triggered the vulnerability.
44
+ # @!attribute [rw] body
45
+ # @return [::String]
46
+ # The body of the request that triggered the vulnerability.
47
+ # @!attribute [rw] description
48
+ # @return [::String]
49
+ # The description of the vulnerability.
50
+ # @!attribute [rw] reproduction_url
51
+ # @return [::String]
52
+ # The URL containing human-readable payload that user can leverage to
53
+ # reproduce the vulnerability.
54
+ # @!attribute [rw] frame_url
55
+ # @return [::String]
56
+ # If the vulnerability was originated from nested IFrame, the immediate
57
+ # parent IFrame is reported.
58
+ # @!attribute [rw] final_url
59
+ # @return [::String]
60
+ # The URL where the browser lands when the vulnerability is detected.
61
+ # @!attribute [rw] tracking_id
62
+ # @return [::String]
63
+ # The tracking ID uniquely identifies a vulnerability instance across
64
+ # multiple ScanRuns.
65
+ # @!attribute [rw] form
66
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::Form]
67
+ # An addon containing information reported for a vulnerability with an HTML
68
+ # form, if any.
69
+ # @!attribute [rw] outdated_library
70
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::OutdatedLibrary]
71
+ # An addon containing information about outdated libraries.
72
+ # @!attribute [rw] violating_resource
73
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::ViolatingResource]
74
+ # An addon containing detailed information regarding any resource causing the
75
+ # vulnerability such as JavaScript sources, image, audio files, etc.
76
+ # @!attribute [rw] vulnerable_headers
77
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::VulnerableHeaders]
78
+ # An addon containing information about vulnerable or missing HTTP headers.
79
+ # @!attribute [rw] vulnerable_parameters
80
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::VulnerableParameters]
81
+ # An addon containing information about request parameters which were found
82
+ # to be vulnerable.
83
+ # @!attribute [rw] xss
84
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::Xss]
85
+ # An addon containing information reported for an XSS, if any.
86
+ class Finding
87
+ include ::Google::Protobuf::MessageExts
88
+ extend ::Google::Protobuf::MessageExts::ClassMethods
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module WebSecurityScanner
23
+ module V1beta
24
+ # ! Information about a vulnerability with an HTML.
25
+ # @!attribute [rw] action_uri
26
+ # @return [::String]
27
+ # ! The URI where to send the form when it's submitted.
28
+ # @!attribute [rw] fields
29
+ # @return [::Array<::String>]
30
+ # ! The names of form fields related to the vulnerability.
31
+ class Form
32
+ include ::Google::Protobuf::MessageExts
33
+ extend ::Google::Protobuf::MessageExts::ClassMethods
34
+ end
35
+
36
+ # Information reported for an outdated library.
37
+ # @!attribute [rw] library_name
38
+ # @return [::String]
39
+ # The name of the outdated library.
40
+ # @!attribute [rw] version
41
+ # @return [::String]
42
+ # The version number.
43
+ # @!attribute [rw] learn_more_urls
44
+ # @return [::Array<::String>]
45
+ # URLs to learn more information about the vulnerabilities in the library.
46
+ class OutdatedLibrary
47
+ include ::Google::Protobuf::MessageExts
48
+ extend ::Google::Protobuf::MessageExts::ClassMethods
49
+ end
50
+
51
+ # Information regarding any resource causing the vulnerability such
52
+ # as JavaScript sources, image, audio files, etc.
53
+ # @!attribute [rw] content_type
54
+ # @return [::String]
55
+ # The MIME type of this resource.
56
+ # @!attribute [rw] resource_url
57
+ # @return [::String]
58
+ # URL of this violating resource.
59
+ class ViolatingResource
60
+ include ::Google::Protobuf::MessageExts
61
+ extend ::Google::Protobuf::MessageExts::ClassMethods
62
+ end
63
+
64
+ # Information about vulnerable request parameters.
65
+ # @!attribute [rw] parameter_names
66
+ # @return [::Array<::String>]
67
+ # The vulnerable parameter names.
68
+ class VulnerableParameters
69
+ include ::Google::Protobuf::MessageExts
70
+ extend ::Google::Protobuf::MessageExts::ClassMethods
71
+ end
72
+
73
+ # Information about vulnerable or missing HTTP Headers.
74
+ # @!attribute [rw] headers
75
+ # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::VulnerableHeaders::Header>]
76
+ # List of vulnerable headers.
77
+ # @!attribute [rw] missing_headers
78
+ # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::VulnerableHeaders::Header>]
79
+ # List of missing headers.
80
+ class VulnerableHeaders
81
+ include ::Google::Protobuf::MessageExts
82
+ extend ::Google::Protobuf::MessageExts::ClassMethods
83
+
84
+ # Describes a HTTP Header.
85
+ # @!attribute [rw] name
86
+ # @return [::String]
87
+ # Header name.
88
+ # @!attribute [rw] value
89
+ # @return [::String]
90
+ # Header value.
91
+ class Header
92
+ include ::Google::Protobuf::MessageExts
93
+ extend ::Google::Protobuf::MessageExts::ClassMethods
94
+ end
95
+ end
96
+
97
+ # Information reported for an XSS.
98
+ # @!attribute [rw] stack_traces
99
+ # @return [::Array<::String>]
100
+ # Stack traces leading to the point where the XSS occurred.
101
+ # @!attribute [rw] error_message
102
+ # @return [::String]
103
+ # An error message generated by a javascript breakage.
104
+ class Xss
105
+ include ::Google::Protobuf::MessageExts
106
+ extend ::Google::Protobuf::MessageExts::ClassMethods
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module WebSecurityScanner
23
+ module V1beta
24
+ # A FindingTypeStats resource represents stats regarding a specific FindingType
25
+ # of Findings under a given ScanRun.
26
+ # @!attribute [rw] finding_type
27
+ # @return [::String]
28
+ # The finding type associated with the stats.
29
+ # @!attribute [rw] finding_count
30
+ # @return [::Integer]
31
+ # The count of findings belonging to this finding type.
32
+ class FindingTypeStats
33
+ include ::Google::Protobuf::MessageExts
34
+ extend ::Google::Protobuf::MessageExts::ClassMethods
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,188 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module WebSecurityScanner
23
+ module V1beta
24
+ # A ScanConfig resource contains the configurations to launch a scan.
25
+ # @!attribute [rw] name
26
+ # @return [::String]
27
+ # The resource name of the ScanConfig. The name follows the format of
28
+ # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. The ScanConfig IDs are
29
+ # generated by the system.
30
+ # @!attribute [rw] display_name
31
+ # @return [::String]
32
+ # Required. The user provided display name of the ScanConfig.
33
+ # @!attribute [rw] max_qps
34
+ # @return [::Integer]
35
+ # The maximum QPS during scanning. A valid value ranges from 5 to 20
36
+ # inclusively. If the field is unspecified or its value is set 0, server will
37
+ # default to 15. Other values outside of [5, 20] range will be rejected with
38
+ # INVALID_ARGUMENT error.
39
+ # @!attribute [rw] starting_urls
40
+ # @return [::Array<::String>]
41
+ # Required. The starting URLs from which the scanner finds site pages.
42
+ # @!attribute [rw] authentication
43
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Authentication]
44
+ # The authentication configuration. If specified, service will use the
45
+ # authentication configuration during scanning.
46
+ # @!attribute [rw] user_agent
47
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::UserAgent]
48
+ # The user agent used during scanning.
49
+ # @!attribute [rw] blacklist_patterns
50
+ # @return [::Array<::String>]
51
+ # The blacklist URL patterns as described in
52
+ # https://cloud.google.com/security-scanner/docs/excluded-urls
53
+ # @!attribute [rw] schedule
54
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Schedule]
55
+ # The schedule of the ScanConfig.
56
+ # @!attribute [rw] target_platforms
57
+ # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::TargetPlatform>]
58
+ # Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be
59
+ # used as a default.
60
+ # @!attribute [rw] export_to_security_command_center
61
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::ExportToSecurityCommandCenter]
62
+ # Controls export of scan configurations and results to Cloud Security
63
+ # Command Center.
64
+ # @!attribute [rw] latest_run
65
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun]
66
+ # Latest ScanRun if available.
67
+ # @!attribute [rw] risk_level
68
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::RiskLevel]
69
+ # The risk level selected for the scan
70
+ class ScanConfig
71
+ include ::Google::Protobuf::MessageExts
72
+ extend ::Google::Protobuf::MessageExts::ClassMethods
73
+
74
+ # Scan authentication configuration.
75
+ # @!attribute [rw] google_account
76
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Authentication::GoogleAccount]
77
+ # Authentication using a Google account.
78
+ # @!attribute [rw] custom_account
79
+ # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Authentication::CustomAccount]
80
+ # Authentication using a custom account.
81
+ class Authentication
82
+ include ::Google::Protobuf::MessageExts
83
+ extend ::Google::Protobuf::MessageExts::ClassMethods
84
+
85
+ # Describes authentication configuration that uses a Google account.
86
+ # @!attribute [rw] username
87
+ # @return [::String]
88
+ # Required. The user name of the Google account.
89
+ # @!attribute [rw] password
90
+ # @return [::String]
91
+ # Required. Input only. The password of the Google account. The credential is stored encrypted
92
+ # and not returned in any response nor included in audit logs.
93
+ class GoogleAccount
94
+ include ::Google::Protobuf::MessageExts
95
+ extend ::Google::Protobuf::MessageExts::ClassMethods
96
+ end
97
+
98
+ # Describes authentication configuration that uses a custom account.
99
+ # @!attribute [rw] username
100
+ # @return [::String]
101
+ # Required. The user name of the custom account.
102
+ # @!attribute [rw] password
103
+ # @return [::String]
104
+ # Required. Input only. The password of the custom account. The credential is stored encrypted
105
+ # and not returned in any response nor included in audit logs.
106
+ # @!attribute [rw] login_url
107
+ # @return [::String]
108
+ # Required. The login form URL of the website.
109
+ class CustomAccount
110
+ include ::Google::Protobuf::MessageExts
111
+ extend ::Google::Protobuf::MessageExts::ClassMethods
112
+ end
113
+ end
114
+
115
+ # Scan schedule configuration.
116
+ # @!attribute [rw] schedule_time
117
+ # @return [::Google::Protobuf::Timestamp]
118
+ # A timestamp indicates when the next run will be scheduled. The value is
119
+ # refreshed by the server after each run. If unspecified, it will default
120
+ # to current server time, which means the scan will be scheduled to start
121
+ # immediately.
122
+ # @!attribute [rw] interval_duration_days
123
+ # @return [::Integer]
124
+ # Required. The duration of time between executions in days.
125
+ class Schedule
126
+ include ::Google::Protobuf::MessageExts
127
+ extend ::Google::Protobuf::MessageExts::ClassMethods
128
+ end
129
+
130
+ # Type of user agents used for scanning.
131
+ module UserAgent
132
+ # The user agent is unknown. Service will default to CHROME_LINUX.
133
+ USER_AGENT_UNSPECIFIED = 0
134
+
135
+ # Chrome on Linux. This is the service default if unspecified.
136
+ CHROME_LINUX = 1
137
+
138
+ # Chrome on Android.
139
+ CHROME_ANDROID = 2
140
+
141
+ # Safari on IPhone.
142
+ SAFARI_IPHONE = 3
143
+ end
144
+
145
+ # Cloud platforms supported by Cloud Web Security Scanner.
146
+ module TargetPlatform
147
+ # The target platform is unknown. Requests with this enum value will be
148
+ # rejected with INVALID_ARGUMENT error.
149
+ TARGET_PLATFORM_UNSPECIFIED = 0
150
+
151
+ # Google App Engine service.
152
+ APP_ENGINE = 1
153
+
154
+ # Google Compute Engine service.
155
+ COMPUTE = 2
156
+ end
157
+
158
+ # Scan risk levels supported by Cloud Web Security Scanner. LOW impact
159
+ # scanning will minimize requests with the potential to modify data. To
160
+ # achieve the maximum scan coverage, NORMAL risk level is recommended.
161
+ module RiskLevel
162
+ # Use default, which is NORMAL.
163
+ RISK_LEVEL_UNSPECIFIED = 0
164
+
165
+ # Normal scanning (Recommended)
166
+ NORMAL = 1
167
+
168
+ # Lower impact scanning
169
+ LOW = 2
170
+ end
171
+
172
+ # Controls export of scan configurations and results to Cloud Security
173
+ # Command Center.
174
+ module ExportToSecurityCommandCenter
175
+ # Use default, which is ENABLED.
176
+ EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0
177
+
178
+ # Export results of this scan to Cloud Security Command Center.
179
+ ENABLED = 1
180
+
181
+ # Do not export results of this scan to Cloud Security Command Center.
182
+ DISABLED = 2
183
+ end
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end