public RepeatedField<IpRule.Types.PortRange> PortRanges { get; }
Optional. An optional list of ports to which this rule applies. This field
is only applicable for the UDP or (S)TCP protocols. Each entry must be
either an integer or a range including a min and max port number.
The IP protocol this rule applies to. This value can either be one of the
following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,
SCTP) or a string representation of the integer value.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Security Command Center v2 API - Class IpRule (1.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.0 (latest)](/dotnet/docs/reference/Google.Cloud.SecurityCenter.V2/latest/Google.Cloud.SecurityCenter.V2.IpRule)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.SecurityCenter.V2/1.1.0/Google.Cloud.SecurityCenter.V2.IpRule)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.SecurityCenter.V2/1.0.0/Google.Cloud.SecurityCenter.V2.IpRule) \n\n public sealed class IpRule : IMessage\u003cIpRule\u003e, IEquatable\u003cIpRule\u003e, IDeepCloneable\u003cIpRule\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Security Command Center v2 API class IpRule.\n\nIP rule information. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e IpRule \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[IpRule](/dotnet/docs/reference/Google.Cloud.SecurityCenter.V2/latest/Google.Cloud.SecurityCenter.V2.IpRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[IpRule](/dotnet/docs/reference/Google.Cloud.SecurityCenter.V2/latest/Google.Cloud.SecurityCenter.V2.IpRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[IpRule](/dotnet/docs/reference/Google.Cloud.SecurityCenter.V2/latest/Google.Cloud.SecurityCenter.V2.IpRule), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.SecurityCenter.V2](/dotnet/docs/reference/Google.Cloud.SecurityCenter.V2/latest/Google.Cloud.SecurityCenter.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.SecurityCenter.V2.dll\n\nConstructors\n------------\n\n### IpRule()\n\n public IpRule()\n\n### IpRule(IpRule)\n\n public IpRule(IpRule other)\n\nProperties\n----------\n\n### PortRanges\n\n public RepeatedField\u003cIpRule.Types.PortRange\u003e PortRanges { get; }\n\nOptional. An optional list of ports to which this rule applies. This field\nis only applicable for the UDP or (S)TCP protocols. Each entry must be\neither an integer or a range including a min and max port number.\n\n### Protocol\n\n public string Protocol { get; set; }\n\nThe IP protocol this rule applies to. This value can either be one of the\nfollowing well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,\nSCTP) or a string representation of the integer value."]]