IngressSecurityRule

class oci.core.models.IngressSecurityRule(**kwargs)

Bases: object

A rule for allowing inbound IP packets.

SOURCE_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'

A constant which can be used with the source_type property of a IngressSecurityRule. This constant has a value of "CIDR_BLOCK"

SOURCE_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'

A constant which can be used with the source_type property of a IngressSecurityRule. This constant has a value of "SERVICE_CIDR_BLOCK"

__init__(**kwargs)

Initializes a new IngressSecurityRule object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • icmp_options (IcmpOptions) -- The value to assign to the icmp_options property of this IngressSecurityRule.
  • is_stateless (bool) -- The value to assign to the is_stateless property of this IngressSecurityRule.
  • protocol (str) -- The value to assign to the protocol property of this IngressSecurityRule.
  • source (str) -- The value to assign to the source property of this IngressSecurityRule.
  • source_type (str) -- The value to assign to the source_type property of this IngressSecurityRule. Allowed values for this property are: "CIDR_BLOCK", "SERVICE_CIDR_BLOCK", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
  • tcp_options (TcpOptions) -- The value to assign to the tcp_options property of this IngressSecurityRule.
  • udp_options (UdpOptions) -- The value to assign to the udp_options property of this IngressSecurityRule.
icmp_options

Gets the icmp_options of this IngressSecurityRule. Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code as defined in:

If you specify ICMP or ICMPv6 as the protocol but omit this object, then all ICMP types and codes are allowed. If you do provide this object, the type is required and the code is optional. To enable MTU negotiation for ingress internet traffic via IPv4, make sure to allow type 3 ("Destination Unreachable") code 4 ("Fragmentation Needed and Don't Fragment was Set"). If you need to specify multiple codes for a single type, create a separate security list rule for each.

Returns:The icmp_options of this IngressSecurityRule.
Return type:IcmpOptions
is_stateless

Gets the is_stateless of this IngressSecurityRule. A stateless rule allows traffic in one direction. Remember to add a corresponding stateless rule in the other direction if you need to support bidirectional traffic. For example, if ingress traffic allows TCP destination port 80, there should be an egress rule to allow TCP source port 80. Defaults to false, which means the rule is stateful and a corresponding rule is not necessary for bidirectional traffic.

Returns:The is_stateless of this IngressSecurityRule.
Return type:bool
protocol

[Required] Gets the protocol of this IngressSecurityRule. The transport protocol. Specify either all or an IPv4 protocol number as defined in Protocol Numbers. Options are supported only for ICMP ("1"), TCP ("6"), UDP ("17"), and ICMPv6 ("58").

Returns:The protocol of this IngressSecurityRule.
Return type:str
source

[Required] Gets the source of this IngressSecurityRule. Conceptually, this is the range of IP addresses that a packet coming into the instance can come from.

Allowed values:

  • IP address range in CIDR notation. For example: 192.168.1.0/24 or 2001:0db8:0123:45::/56. Note that IPv6 addressing is currently supported only in the Government Cloud.
  • The cidrBlock value for a Service, if you're setting up a security list rule for traffic coming from a particular Service through a service gateway. For example: oci-phx-objectstorage.
Returns:The source of this IngressSecurityRule.
Return type:str
source_type

Gets the source_type of this IngressSecurityRule. Type of source for the rule. The default is CIDR_BLOCK.

  • CIDR_BLOCK: If the rule's source is an IP address range in CIDR notation.
  • SERVICE_CIDR_BLOCK: If the rule's source is the cidrBlock value for a Service (the rule is for traffic coming from a particular Service through a service gateway).

Allowed values for this property are: "CIDR_BLOCK", "SERVICE_CIDR_BLOCK", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The source_type of this IngressSecurityRule.
Return type:str
tcp_options

Gets the tcp_options of this IngressSecurityRule. Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. If you specify TCP as the protocol but omit this object, then all destination ports are allowed.

Returns:The tcp_options of this IngressSecurityRule.
Return type:TcpOptions
udp_options

Gets the udp_options of this IngressSecurityRule. Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. If you specify UDP as the protocol but omit this object, then all destination ports are allowed.

Returns:The udp_options of this IngressSecurityRule.
Return type:UdpOptions