Skip to content

Commit

Permalink
feat: added NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN to ScanRunWarningT…
Browse files Browse the repository at this point in the history
…race.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=
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Sep 8, 2022
1 parent b7711a6 commit 241ecd9
Show file tree
Hide file tree
Showing 8 changed files with 445 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void CreateScanConfigRequestObject()
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
ManagedScan = true,
StaticIpScan = false,
IgnoreHttpStatusErrors = false,
};
mockGrpcClient.Setup(x => x.CreateScanConfig(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
Expand Down Expand Up @@ -94,6 +95,7 @@ public void CreateScanConfigRequestObject()
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
ManagedScan = true,
StaticIpScan = false,
IgnoreHttpStatusErrors = false,
};
mockGrpcClient.Setup(x => x.CreateScanConfigAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<ScanConfig>(stt::Task.FromResult(expectedResponse), null, null, null, null));
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
Expand Down Expand Up @@ -163,6 +165,7 @@ public void GetScanConfigRequestObject()
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
ManagedScan = true,
StaticIpScan = false,
IgnoreHttpStatusErrors = false,
};
mockGrpcClient.Setup(x => x.GetScanConfig(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
Expand Down Expand Up @@ -199,6 +202,7 @@ public void GetScanConfigRequestObject()
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
ManagedScan = true,
StaticIpScan = false,
IgnoreHttpStatusErrors = false,
};
mockGrpcClient.Setup(x => x.GetScanConfigAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<ScanConfig>(stt::Task.FromResult(expectedResponse), null, null, null, null));
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
Expand Down Expand Up @@ -238,6 +242,7 @@ public void UpdateScanConfigRequestObject()
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
ManagedScan = true,
StaticIpScan = false,
IgnoreHttpStatusErrors = false,
};
mockGrpcClient.Setup(x => x.UpdateScanConfig(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
Expand Down Expand Up @@ -275,6 +280,7 @@ public void UpdateScanConfigRequestObject()
RiskLevel = ScanConfig.Types.RiskLevel.Unspecified,
ManagedScan = true,
StaticIpScan = false,
IgnoreHttpStatusErrors = false,
};
mockGrpcClient.Setup(x => x.UpdateScanConfigAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<ScanConfig>(stt::Task.FromResult(expectedResponse), null, null, null, null));
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
Expand Down Expand Up @@ -510,6 +516,7 @@ public void GetFindingRequestObject()
VulnerableHeaders = new VulnerableHeaders(),
Form = new Form(),
Severity = Finding.Types.Severity.Medium,
Xxe = new Xxe(),
};
mockGrpcClient.Setup(x => x.GetFinding(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
Expand Down Expand Up @@ -545,6 +552,7 @@ public void GetFindingRequestObject()
VulnerableHeaders = new VulnerableHeaders(),
Form = new Form(),
Severity = Finding.Types.Severity.Medium,
Xxe = new Xxe(),
};
mockGrpcClient.Setup(x => x.GetFindingAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Finding>(stt::Task.FromResult(expectedResponse), null, null, null, null));
WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static partial class FindingReflection {
"cHJvdG8SImdvb2dsZS5jbG91ZC53ZWJzZWN1cml0eXNjYW5uZXIudjEaH2dv",
"b2dsZS9hcGkvZmllbGRfYmVoYXZpb3IucHJvdG8aGWdvb2dsZS9hcGkvcmVz",
"b3VyY2UucHJvdG8aNmdvb2dsZS9jbG91ZC93ZWJzZWN1cml0eXNjYW5uZXIv",
"djEvZmluZGluZ19hZGRvbi5wcm90byKxBwoHRmluZGluZxIMCgRuYW1lGAEg",
"djEvZmluZGluZ19hZGRvbi5wcm90byLsBwoHRmluZGluZxIMCgRuYW1lGAEg",
"ASgJEhQKDGZpbmRpbmdfdHlwZRgCIAEoCRJLCghzZXZlcml0eRgRIAEoDjI0",
"Lmdvb2dsZS5jbG91ZC53ZWJzZWN1cml0eXNjYW5uZXIudjEuRmluZGluZy5T",
"ZXZlcml0eUID4EEDEhMKC2h0dHBfbWV0aG9kGAMgASgJEhIKCmZ1enplZF91",
Expand All @@ -44,22 +44,23 @@ public static partial class FindingReflection {
"bmVyLnYxLlZ1bG5lcmFibGVIZWFkZXJzElcKFXZ1bG5lcmFibGVfcGFyYW1l",
"dGVycxgNIAEoCzI4Lmdvb2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gcKA0xPVxAEOoQB6kGA",
"AQopd2Vic2VjdXJpdHlzY2FubmVyLmdvb2dsZWFwaXMuY29tL0ZpbmRpbmcS",
"U3Byb2plY3RzL3twcm9qZWN0fS9zY2FuQ29uZmlncy97c2Nhbl9jb25maWd9",
"L3NjYW5SdW5zL3tzY2FuX3J1bn0vZmluZGluZ3Mve2ZpbmRpbmd9QoACCiZj",
"b20uZ29vZ2xlLmNsb3VkLndlYnNlY3VyaXR5c2Nhbm5lci52MUIMRmluZGlu",
"Z1Byb3RvUAFaVGdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFw",
"aXMvY2xvdWQvd2Vic2VjdXJpdHlzY2FubmVyL3YxO3dlYnNlY3VyaXR5c2Nh",
"bm5lcqoCIkdvb2dsZS5DbG91ZC5XZWJTZWN1cml0eVNjYW5uZXIuVjHKAiJH",
"b29nbGVcQ2xvdWRcV2ViU2VjdXJpdHlTY2FubmVyXFYx6gIlR29vZ2xlOjpD",
"bG91ZDo6V2ViU2VjdXJpdHlTY2FubmVyOjpWMWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Cloud.WebSecurityScanner.V1.FindingAddonReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
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)
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)
}));
}
#endregion
Expand Down Expand Up @@ -121,6 +122,7 @@ public sealed partial class Finding : pb::IMessage<Finding>
vulnerableHeaders_ = other.vulnerableHeaders_ != null ? other.vulnerableHeaders_.Clone() : null;
vulnerableParameters_ = other.vulnerableParameters_ != null ? other.vulnerableParameters_.Clone() : null;
xss_ = other.xss_ != null ? other.xss_.Clone() : null;
xxe_ = other.xxe_ != null ? other.xxe_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

Expand Down Expand Up @@ -397,6 +399,21 @@ public sealed partial class Finding : pb::IMessage<Finding>
}
}

/// <summary>Field number for the "xxe" field.</summary>
public const int XxeFieldNumber = 18;
private global::Google.Cloud.WebSecurityScanner.V1.Xxe xxe_;
/// <summary>
/// Output only. An addon containing information reported for an XXE, if any.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::Google.Cloud.WebSecurityScanner.V1.Xxe Xxe {
get { return xxe_; }
set {
xxe_ = value;
}
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
Expand Down Expand Up @@ -429,6 +446,7 @@ public sealed partial class Finding : pb::IMessage<Finding>
if (!object.Equals(VulnerableHeaders, other.VulnerableHeaders)) return false;
if (!object.Equals(VulnerableParameters, other.VulnerableParameters)) return false;
if (!object.Equals(Xss, other.Xss)) return false;
if (!object.Equals(Xxe, other.Xxe)) return false;
return Equals(_unknownFields, other._unknownFields);
}

Expand All @@ -453,6 +471,7 @@ public sealed partial class Finding : pb::IMessage<Finding>
if (vulnerableHeaders_ != null) hash ^= VulnerableHeaders.GetHashCode();
if (vulnerableParameters_ != null) hash ^= VulnerableParameters.GetHashCode();
if (xss_ != null) hash ^= Xss.GetHashCode();
if (xxe_ != null) hash ^= Xxe.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
Expand Down Expand Up @@ -539,6 +558,10 @@ public sealed partial class Finding : pb::IMessage<Finding>
output.WriteRawTag(136, 1);
output.WriteEnum((int) Severity);
}
if (xxe_ != null) {
output.WriteRawTag(146, 1);
output.WriteMessage(Xxe);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
Expand Down Expand Up @@ -617,6 +640,10 @@ public sealed partial class Finding : pb::IMessage<Finding>
output.WriteRawTag(136, 1);
output.WriteEnum((int) Severity);
}
if (xxe_ != null) {
output.WriteRawTag(146, 1);
output.WriteMessage(Xxe);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
Expand Down Expand Up @@ -678,6 +705,9 @@ public sealed partial class Finding : pb::IMessage<Finding>
if (xss_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Xss);
}
if (xxe_ != null) {
size += 2 + pb::CodedOutputStream.ComputeMessageSize(Xxe);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
Expand Down Expand Up @@ -759,6 +789,12 @@ public sealed partial class Finding : pb::IMessage<Finding>
}
Xss.MergeFrom(other.Xss);
}
if (other.xxe_ != null) {
if (xxe_ == null) {
Xxe = new global::Google.Cloud.WebSecurityScanner.V1.Xxe();
}
Xxe.MergeFrom(other.Xxe);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}

Expand Down Expand Up @@ -860,6 +896,13 @@ public sealed partial class Finding : pb::IMessage<Finding>
Severity = (global::Google.Cloud.WebSecurityScanner.V1.Finding.Types.Severity) input.ReadEnum();
break;
}
case 146: {
if (xxe_ == null) {
Xxe = new global::Google.Cloud.WebSecurityScanner.V1.Xxe();
}
input.ReadMessage(Xxe);
break;
}
}
}
#endif
Expand Down Expand Up @@ -961,6 +1004,13 @@ public sealed partial class Finding : pb::IMessage<Finding>
Severity = (global::Google.Cloud.WebSecurityScanner.V1.Finding.Types.Severity) input.ReadEnum();
break;
}
case 146: {
if (xxe_ == null) {
Xxe = new global::Google.Cloud.WebSecurityScanner.V1.Xxe();
}
input.ReadMessage(Xxe);
break;
}
}
}
}
Expand Down
Loading

0 comments on commit 241ecd9

Please sign in to comment.