Skip to content

Commit 241ecd9

Browse files
gcf-owl-bot[bot]jskeet
authored andcommitted
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: googleapis/googleapis-gen@2370420 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuV2ViU2VjdXJpdHlTY2FubmVyLlYxLy5Pd2xCb3QueWFtbCIsImgiOiIyMzcwNDIwMjNmMTA4YjE0YzA0MjcxMTg0NTI0MWZiYjYyY2YyZTA4In0=
1 parent b7711a6 commit 241ecd9

8 files changed

Lines changed: 445 additions & 77 deletions

File tree

apis/Google.Cloud.WebSecurityScanner.V1/Google.Cloud.WebSecurityScanner.V1.Tests/WebSecurityScannerClientTest.g.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public void CreateScanConfigRequestObject()
5757
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
5858
ManagedScan = true,
5959
StaticIpScan = false,
60+
IgnoreHttpStatusErrors = false,
6061
};
6162
mockGrpcClient.Setup(x => x.CreateScanConfig(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
6263
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
@@ -94,6 +95,7 @@ public void CreateScanConfigRequestObject()
9495
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
9596
ManagedScan = true,
9697
StaticIpScan = false,
98+
IgnoreHttpStatusErrors = false,
9799
};
98100
mockGrpcClient.Setup(x => x.CreateScanConfigAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<ScanConfig>(stt::Task.FromResult(expectedResponse), null, null, null, null));
99101
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
@@ -163,6 +165,7 @@ public void GetScanConfigRequestObject()
163165
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
164166
ManagedScan = true,
165167
StaticIpScan = false,
168+
IgnoreHttpStatusErrors = false,
166169
};
167170
mockGrpcClient.Setup(x => x.GetScanConfig(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
168171
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
@@ -199,6 +202,7 @@ public void GetScanConfigRequestObject()
199202
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
200203
ManagedScan = true,
201204
StaticIpScan = false,
205+
IgnoreHttpStatusErrors = false,
202206
};
203207
mockGrpcClient.Setup(x => x.GetScanConfigAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<ScanConfig>(stt::Task.FromResult(expectedResponse), null, null, null, null));
204208
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
@@ -238,6 +242,7 @@ public void UpdateScanConfigRequestObject()
238242
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
239243
ManagedScan = true,
240244
StaticIpScan = false,
245+
IgnoreHttpStatusErrors = false,
241246
};
242247
mockGrpcClient.Setup(x => x.UpdateScanConfig(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
243248
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
@@ -275,6 +280,7 @@ public void UpdateScanConfigRequestObject()
275280
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
276281
ManagedScan = true,
277282
StaticIpScan = false,
283+
IgnoreHttpStatusErrors = false,
278284
};
279285
mockGrpcClient.Setup(x => x.UpdateScanConfigAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<ScanConfig>(stt::Task.FromResult(expectedResponse), null, null, null, null));
280286
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
@@ -510,6 +516,7 @@ public void GetFindingRequestObject()
510516
VulnerableHeaders = new VulnerableHeaders(),
511517
Form = new Form(),
512518
Severity = Finding.Types.Severity.Medium,
519+
Xxe = new Xxe(),
513520
};
514521
mockGrpcClient.Setup(x => x.GetFinding(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
515522
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
@@ -545,6 +552,7 @@ public void GetFindingRequestObject()
545552
VulnerableHeaders = new VulnerableHeaders(),
546553
Form = new Form(),
547554
Severity = Finding.Types.Severity.Medium,
555+
Xxe = new Xxe(),
548556
};
549557
mockGrpcClient.Setup(x => x.GetFindingAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Finding>(stt::Task.FromResult(expectedResponse), null, null, null, null));
550558
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);

apis/Google.Cloud.WebSecurityScanner.V1/Google.Cloud.WebSecurityScanner.V1/Finding.g.cs

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static FindingReflection() {
2828
"cHJvdG8SImdvb2dsZS5jbG91ZC53ZWJzZWN1cml0eXNjYW5uZXIudjEaH2dv",
2929
"b2dsZS9hcGkvZmllbGRfYmVoYXZpb3IucHJvdG8aGWdvb2dsZS9hcGkvcmVz",
3030
"b3VyY2UucHJvdG8aNmdvb2dsZS9jbG91ZC93ZWJzZWN1cml0eXNjYW5uZXIv",
31-
"djEvZmluZGluZ19hZGRvbi5wcm90byKxBwoHRmluZGluZxIMCgRuYW1lGAEg",
31+
"djEvZmluZGluZ19hZGRvbi5wcm90byLsBwoHRmluZGluZxIMCgRuYW1lGAEg",
3232
"ASgJEhQKDGZpbmRpbmdfdHlwZRgCIAEoCRJLCghzZXZlcml0eRgRIAEoDjI0",
3333
"Lmdvb2dsZ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ldlYlNlY3Vy",
58-
"aXR5U2Nhbm5lcjo6VjFiBnByb3RvMw=="));
47+
"LmNsb3VkLndlYnNlY3VyaXR5c2Nhbm5lci52MS5Yc3MSOQoDeHhlGBIgASgL",
48+
"MicuZ29vZ2xlLmNsb3VkLndlYnNlY3VyaXR5c2Nhbm5lci52MS5YeGVCA+BB",
49+
"AyJRCghTZXZlcml0eRIYChRTRVZFUklUWV9VTlNQRUNJRklFRBAAEgwKCENS",
50+
"SVRJQ0FMEAESCAoESElHSBACEgoKBk1FRElVTRADEgcKA0xPVxAEOoQB6kGA",
51+
"AQopd2Vic2VjdXJpdHlzY2FubmVyLmdvb2dsZWFwaXMuY29tL0ZpbmRpbmcS",
52+
"U3Byb2plY3RzL3twcm9qZWN0fS9zY2FuQ29uZmlncy97c2Nhbl9jb25maWd9",
53+
"L3NjYW5SdW5zL3tzY2FuX3J1bn0vZmluZGluZ3Mve2ZpbmRpbmd9QoACCiZj",
54+
"b20uZ29vZ2xlLmNsb3VkLndlYnNlY3VyaXR5c2Nhbm5lci52MUIMRmluZGlu",
55+
"Z1Byb3RvUAFaVGdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFw",
56+
"aXMvY2xvdWQvd2Vic2VjdXJpdHlzY2FubmVyL3YxO3dlYnNlY3VyaXR5c2Nh",
57+
"bm5lcqoCIkdvb2dsZS5DbG91ZC5XZWJTZWN1cml0eVNjYW5uZXIuVjHKAiJH",
58+
"b29nbGVcQ2xvdWRcV2ViU2VjdXJpdHlTY2FubmVyXFYx6gIlR29vZ2xlOjpD",
59+
"bG91ZDo6V2ViU2VjdXJpdHlTY2FubmVyOjpWMWIGcHJvdG8z"));
5960
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
6061
new pbr::FileDescriptor[] { global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Cloud.WebSecurityScanner.V1.FindingAddonReflection.Descriptor, },
6162
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
62-
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.WebSecurityScanner.V1.Finding), global::Google.Cloud.WebSecurityScanner.V1.Finding.Parser, new[]{ "Name", "FindingType", "Severity", "HttpMethod", "FuzzedUrl", "Body", "Description", "ReproductionUrl", "FrameUrl", "FinalUrl", "TrackingId", "Form", "OutdatedLibrary", "ViolatingResource", "VulnerableHeaders", "VulnerableParameters", "Xss" }, null, new[]{ typeof(global::Google.Cloud.WebSecurityScanner.V1.Finding.Types.Severity) }, null, null)
63+
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.WebSecurityScanner.V1.Finding), global::Google.Cloud.WebSecurityScanner.V1.Finding.Parser, new[]{ "Name", "FindingType", "Severity", "HttpMethod", "FuzzedUrl", "Body", "Description", "ReproductionUrl", "FrameUrl", "FinalUrl", "TrackingId", "Form", "OutdatedLibrary", "ViolatingResource", "VulnerableHeaders", "VulnerableParameters", "Xss", "Xxe" }, null, new[]{ typeof(global::Google.Cloud.WebSecurityScanner.V1.Finding.Types.Severity) }, null, null)
6364
}));
6465
}
6566
#endregion
@@ -121,6 +122,7 @@ public Finding(Finding other) : this() {
121122
vulnerableHeaders_ = other.vulnerableHeaders_ != null ? other.vulnerableHeaders_.Clone() : null;
122123
vulnerableParameters_ = other.vulnerableParameters_ != null ? other.vulnerableParameters_.Clone() : null;
123124
xss_ = other.xss_ != null ? other.xss_.Clone() : null;
125+
xxe_ = other.xxe_ != null ? other.xxe_.Clone() : null;
124126
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
125127
}
126128

@@ -397,6 +399,21 @@ public string TrackingId {
397399
}
398400
}
399401

402+
/// <summary>Field number for the "xxe" field.</summary>
403+
public const int XxeFieldNumber = 18;
404+
private global::Google.Cloud.WebSecurityScanner.V1.Xxe xxe_;
405+
/// <summary>
406+
/// Output only. An addon containing information reported for an XXE, if any.
407+
/// </summary>
408+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
409+
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
410+
public global::Google.Cloud.WebSecurityScanner.V1.Xxe Xxe {
411+
get { return xxe_; }
412+
set {
413+
xxe_ = value;
414+
}
415+
}
416+
400417
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
401418
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
402419
public override bool Equals(object other) {
@@ -429,6 +446,7 @@ public bool Equals(Finding other) {
429446
if (!object.Equals(VulnerableHeaders, other.VulnerableHeaders)) return false;
430447
if (!object.Equals(VulnerableParameters, other.VulnerableParameters)) return false;
431448
if (!object.Equals(Xss, other.Xss)) return false;
449+
if (!object.Equals(Xxe, other.Xxe)) return false;
432450
return Equals(_unknownFields, other._unknownFields);
433451
}
434452

@@ -453,6 +471,7 @@ public override int GetHashCode() {
453471
if (vulnerableHeaders_ != null) hash ^= VulnerableHeaders.GetHashCode();
454472
if (vulnerableParameters_ != null) hash ^= VulnerableParameters.GetHashCode();
455473
if (xss_ != null) hash ^= Xss.GetHashCode();
474+
if (xxe_ != null) hash ^= Xxe.GetHashCode();
456475
if (_unknownFields != null) {
457476
hash ^= _unknownFields.GetHashCode();
458477
}
@@ -539,6 +558,10 @@ public void WriteTo(pb::CodedOutputStream output) {
539558
output.WriteRawTag(136, 1);
540559
output.WriteEnum((int) Severity);
541560
}
561+
if (xxe_ != null) {
562+
output.WriteRawTag(146, 1);
563+
output.WriteMessage(Xxe);
564+
}
542565
if (_unknownFields != null) {
543566
_unknownFields.WriteTo(output);
544567
}
@@ -617,6 +640,10 @@ public void WriteTo(pb::CodedOutputStream output) {
617640
output.WriteRawTag(136, 1);
618641
output.WriteEnum((int) Severity);
619642
}
643+
if (xxe_ != null) {
644+
output.WriteRawTag(146, 1);
645+
output.WriteMessage(Xxe);
646+
}
620647
if (_unknownFields != null) {
621648
_unknownFields.WriteTo(ref output);
622649
}
@@ -678,6 +705,9 @@ public int CalculateSize() {
678705
if (xss_ != null) {
679706
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Xss);
680707
}
708+
if (xxe_ != null) {
709+
size += 2 + pb::CodedOutputStream.ComputeMessageSize(Xxe);
710+
}
681711
if (_unknownFields != null) {
682712
size += _unknownFields.CalculateSize();
683713
}
@@ -759,6 +789,12 @@ public void MergeFrom(Finding other) {
759789
}
760790
Xss.MergeFrom(other.Xss);
761791
}
792+
if (other.xxe_ != null) {
793+
if (xxe_ == null) {
794+
Xxe = new global::Google.Cloud.WebSecurityScanner.V1.Xxe();
795+
}
796+
Xxe.MergeFrom(other.Xxe);
797+
}
762798
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
763799
}
764800

@@ -860,6 +896,13 @@ public void MergeFrom(pb::CodedInputStream input) {
860896
Severity = (global::Google.Cloud.WebSecurityScanner.V1.Finding.Types.Severity) input.ReadEnum();
861897
break;
862898
}
899+
case 146: {
900+
if (xxe_ == null) {
901+
Xxe = new global::Google.Cloud.WebSecurityScanner.V1.Xxe();
902+
}
903+
input.ReadMessage(Xxe);
904+
break;
905+
}
863906
}
864907
}
865908
#endif
@@ -961,6 +1004,13 @@ public void MergeFrom(pb::CodedInputStream input) {
9611004
Severity = (global::Google.Cloud.WebSecurityScanner.V1.Finding.Types.Severity) input.ReadEnum();
9621005
break;
9631006
}
1007+
case 146: {
1008+
if (xxe_ == null) {
1009+
Xxe = new global::Google.Cloud.WebSecurityScanner.V1.Xxe();
1010+
}
1011+
input.ReadMessage(Xxe);
1012+
break;
1013+
}
9641014
}
9651015
}
9661016
}

0 commit comments

Comments
 (0)