Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 42f2a1e

Browse files
chore: use gapic-generator-python 1.3.1 (#238)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 472772457 Source-Link: googleapis/googleapis@855b74d Source-Link: https://github.com/googleapis/googleapis-gen/commit/b64b1e7da3e138f15ca361552ef0545e54891b4f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjY0YjFlN2RhM2UxMzhmMTVjYTM2MTU1MmVmMDU0NWU1NDg5MWI0ZiJ9 feat: added NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN to ScanRunWarningTrace.Code fix: Added fix to return a list of the endpoints that encountered errors during crawl, along with the specific error message when the starting URL returns Http errors fix: GoogleAccount is deprecated PiperOrigin-RevId: 472758119 Source-Link: googleapis/googleapis@4356ba6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/237042023f108b14c042711845241fbb62cf2e08 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjM3MDQyMDIzZjEwOGIxNGMwNDI3MTE4NDUyNDFmYmI2MmNmMmUwOCJ9
1 parent c48ff69 commit 42f2a1e

File tree

11 files changed

+71
-7
lines changed

11 files changed

+71
-7
lines changed

google/cloud/websecurityscanner/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
VulnerableHeaders,
3030
VulnerableParameters,
3131
Xss,
32+
Xxe,
3233
)
3334
from google.cloud.websecurityscanner_v1.types.finding_type_stats import FindingTypeStats
3435
from google.cloud.websecurityscanner_v1.types.scan_config import ScanConfig
@@ -73,6 +74,7 @@
7374
"VulnerableHeaders",
7475
"VulnerableParameters",
7576
"Xss",
77+
"Xxe",
7678
"FindingTypeStats",
7779
"ScanConfig",
7880
"ScanConfigError",

google/cloud/websecurityscanner_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
VulnerableHeaders,
2828
VulnerableParameters,
2929
Xss,
30+
Xxe,
3031
)
3132
from .types.finding_type_stats import FindingTypeStats
3233
from .types.scan_config import ScanConfig
@@ -92,4 +93,5 @@
9293
"VulnerableParameters",
9394
"WebSecurityScannerClient",
9495
"Xss",
96+
"Xxe",
9597
)

google/cloud/websecurityscanner_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
VulnerableHeaders,
2323
VulnerableParameters,
2424
Xss,
25+
Xxe,
2526
)
2627
from .finding_type_stats import FindingTypeStats
2728
from .scan_config import ScanConfig
@@ -60,6 +61,7 @@
6061
"VulnerableHeaders",
6162
"VulnerableParameters",
6263
"Xss",
64+
"Xxe",
6365
"FindingTypeStats",
6466
"ScanConfig",
6567
"ScanConfigError",

google/cloud/websecurityscanner_v1/types/finding.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ class Finding(proto.Message):
9393
xss (google.cloud.websecurityscanner_v1.types.Xss):
9494
Output only. An addon containing information
9595
reported for an XSS, if any.
96+
xxe (google.cloud.websecurityscanner_v1.types.Xxe):
97+
Output only. An addon containing information
98+
reported for an XXE, if any.
9699
"""
97100

98101
class Severity(proto.Enum):
@@ -178,6 +181,11 @@ class Severity(proto.Enum):
178181
number=14,
179182
message=finding_addon.Xss,
180183
)
184+
xxe = proto.Field(
185+
proto.MESSAGE,
186+
number=18,
187+
message=finding_addon.Xxe,
188+
)
181189

182190

183191
__all__ = tuple(sorted(__protobuf__.manifest))

google/cloud/websecurityscanner_v1/types/finding_addon.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"VulnerableParameters",
2525
"VulnerableHeaders",
2626
"Xss",
27+
"Xxe",
2728
},
2829
)
2930

@@ -209,4 +210,33 @@ class AttackVector(proto.Enum):
209210
)
210211

211212

213+
class Xxe(proto.Message):
214+
r"""Information reported for an XXE.
215+
216+
Attributes:
217+
payload_value (str):
218+
The XML string that triggered the XXE
219+
vulnerability. Non-payload values might be
220+
redacted.
221+
payload_location (google.cloud.websecurityscanner_v1.types.Xxe.Location):
222+
Location within the request where the payload
223+
was placed.
224+
"""
225+
226+
class Location(proto.Enum):
227+
r"""Locations within a request where XML was substituted."""
228+
LOCATION_UNSPECIFIED = 0
229+
COMPLETE_REQUEST_BODY = 1
230+
231+
payload_value = proto.Field(
232+
proto.STRING,
233+
number=1,
234+
)
235+
payload_location = proto.Field(
236+
proto.ENUM,
237+
number=2,
238+
enum=Location,
239+
)
240+
241+
212242
__all__ = tuple(sorted(__protobuf__.manifest))

google/cloud/websecurityscanner_v1/types/scan_config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ class ScanConfig(proto.Message):
6969
static IP address scan feature. If enabled, the
7070
scanner will access applications from static IP
7171
addresses.
72+
ignore_http_status_errors (bool):
73+
Whether to keep scanning even if most
74+
requests return HTTP error codes.
7275
"""
7376

7477
class UserAgent(proto.Enum):
@@ -313,6 +316,10 @@ class Schedule(proto.Message):
313316
proto.BOOL,
314317
number=14,
315318
)
319+
ignore_http_status_errors = proto.Field(
320+
proto.BOOL,
321+
number=15,
322+
)
316323

317324

318325
__all__ = tuple(sorted(__protobuf__.manifest))

google/cloud/websecurityscanner_v1/types/scan_run_error_trace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ScanRunErrorTrace(proto.Message):
4949
class Code(proto.Enum):
5050
r"""Output only.
5151
Defines an error reason code.
52-
Next id: 7
52+
Next id: 8
5353
"""
5454
CODE_UNSPECIFIED = 0
5555
INTERNAL_ERROR = 1

google/cloud/websecurityscanner_v1/types/scan_run_warning_trace.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class Code(proto.Enum):
4444
TOO_MANY_CRAWL_RESULTS = 2
4545
TOO_MANY_FUZZ_TASKS = 3
4646
BLOCKED_BY_IAP = 4
47+
NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN = 5
4748

4849
code = proto.Field(
4950
proto.ENUM,

tests/unit/gapic/websecurityscanner_v1/test_web_security_scanner.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# try/except added for compatibility with python < 3.8
1919
try:
2020
from unittest import mock
21-
from unittest.mock import AsyncMock
22-
except ImportError:
21+
from unittest.mock import AsyncMock # pragma: NO COVER
22+
except ImportError: # pragma: NO COVER
2323
import mock
2424

2525
import math
@@ -739,6 +739,7 @@ def test_create_scan_config(request_type, transport: str = "grpc"):
739739
risk_level=scan_config.ScanConfig.RiskLevel.NORMAL,
740740
managed_scan=True,
741741
static_ip_scan=True,
742+
ignore_http_status_errors=True,
742743
)
743744
response = client.create_scan_config(request)
744745

@@ -762,6 +763,7 @@ def test_create_scan_config(request_type, transport: str = "grpc"):
762763
assert response.risk_level == scan_config.ScanConfig.RiskLevel.NORMAL
763764
assert response.managed_scan is True
764765
assert response.static_ip_scan is True
766+
assert response.ignore_http_status_errors is True
765767

766768

767769
def test_create_scan_config_empty_call():
@@ -813,6 +815,7 @@ async def test_create_scan_config_async(
813815
risk_level=scan_config.ScanConfig.RiskLevel.NORMAL,
814816
managed_scan=True,
815817
static_ip_scan=True,
818+
ignore_http_status_errors=True,
816819
)
817820
)
818821
response = await client.create_scan_config(request)
@@ -837,6 +840,7 @@ async def test_create_scan_config_async(
837840
assert response.risk_level == scan_config.ScanConfig.RiskLevel.NORMAL
838841
assert response.managed_scan is True
839842
assert response.static_ip_scan is True
843+
assert response.ignore_http_status_errors is True
840844

841845

842846
@pytest.mark.asyncio
@@ -1091,6 +1095,7 @@ def test_get_scan_config(request_type, transport: str = "grpc"):
10911095
risk_level=scan_config.ScanConfig.RiskLevel.NORMAL,
10921096
managed_scan=True,
10931097
static_ip_scan=True,
1098+
ignore_http_status_errors=True,
10941099
)
10951100
response = client.get_scan_config(request)
10961101

@@ -1114,6 +1119,7 @@ def test_get_scan_config(request_type, transport: str = "grpc"):
11141119
assert response.risk_level == scan_config.ScanConfig.RiskLevel.NORMAL
11151120
assert response.managed_scan is True
11161121
assert response.static_ip_scan is True
1122+
assert response.ignore_http_status_errors is True
11171123

11181124

11191125
def test_get_scan_config_empty_call():
@@ -1161,6 +1167,7 @@ async def test_get_scan_config_async(
11611167
risk_level=scan_config.ScanConfig.RiskLevel.NORMAL,
11621168
managed_scan=True,
11631169
static_ip_scan=True,
1170+
ignore_http_status_errors=True,
11641171
)
11651172
)
11661173
response = await client.get_scan_config(request)
@@ -1185,6 +1192,7 @@ async def test_get_scan_config_async(
11851192
assert response.risk_level == scan_config.ScanConfig.RiskLevel.NORMAL
11861193
assert response.managed_scan is True
11871194
assert response.static_ip_scan is True
1195+
assert response.ignore_http_status_errors is True
11881196

11891197

11901198
@pytest.mark.asyncio
@@ -1643,6 +1651,7 @@ def test_update_scan_config(request_type, transport: str = "grpc"):
16431651
risk_level=scan_config.ScanConfig.RiskLevel.NORMAL,
16441652
managed_scan=True,
16451653
static_ip_scan=True,
1654+
ignore_http_status_errors=True,
16461655
)
16471656
response = client.update_scan_config(request)
16481657

@@ -1666,6 +1675,7 @@ def test_update_scan_config(request_type, transport: str = "grpc"):
16661675
assert response.risk_level == scan_config.ScanConfig.RiskLevel.NORMAL
16671676
assert response.managed_scan is True
16681677
assert response.static_ip_scan is True
1678+
assert response.ignore_http_status_errors is True
16691679

16701680

16711681
def test_update_scan_config_empty_call():
@@ -1717,6 +1727,7 @@ async def test_update_scan_config_async(
17171727
risk_level=scan_config.ScanConfig.RiskLevel.NORMAL,
17181728
managed_scan=True,
17191729
static_ip_scan=True,
1730+
ignore_http_status_errors=True,
17201731
)
17211732
)
17221733
response = await client.update_scan_config(request)
@@ -1741,6 +1752,7 @@ async def test_update_scan_config_async(
17411752
assert response.risk_level == scan_config.ScanConfig.RiskLevel.NORMAL
17421753
assert response.managed_scan is True
17431754
assert response.static_ip_scan is True
1755+
assert response.ignore_http_status_errors is True
17441756

17451757

17461758
@pytest.mark.asyncio

tests/unit/gapic/websecurityscanner_v1alpha/test_web_security_scanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# try/except added for compatibility with python < 3.8
1919
try:
2020
from unittest import mock
21-
from unittest.mock import AsyncMock
22-
except ImportError:
21+
from unittest.mock import AsyncMock # pragma: NO COVER
22+
except ImportError: # pragma: NO COVER
2323
import mock
2424

2525
import math

0 commit comments

Comments
 (0)