EgressSecurityRule

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

Bases: object

A rule for allowing outbound IP packets.

DESTINATION_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'

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

DESTINATION_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'

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

__init__(**kwargs)

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

Parameters:
  • destination (str) -- The value to assign to the destination property of this EgressSecurityRule.
  • destination_type (str) -- The value to assign to the destination_type property of this EgressSecurityRule. 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'.
  • icmp_options (IcmpOptions) -- The value to assign to the icmp_options property of this EgressSecurityRule.
  • is_stateless (bool) -- The value to assign to the is_stateless property of this EgressSecurityRule.
  • protocol (str) -- The value to assign to the protocol property of this EgressSecurityRule.
  • tcp_options (TcpOptions) -- The value to assign to the tcp_options property of this EgressSecurityRule.
  • udp_options (UdpOptions) -- The value to assign to the udp_options property of this EgressSecurityRule.
destination

[Required] Gets the destination of this EgressSecurityRule. Conceptually, this is the range of IP addresses that a packet originating from the instance can go to.

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 destined for a particular Service through a service gateway. For example: oci-phx-objectstorage.
Returns:The destination of this EgressSecurityRule.
Return type:str
destination_type

Gets the destination_type of this EgressSecurityRule. Type of destination for the rule. The default is CIDR_BLOCK.

Allowed values:

  • CIDR_BLOCK: If the rule's destination is an IP address range in CIDR notation.
  • SERVICE_CIDR_BLOCK: If the rule's destination is the cidrBlock value for a Service (the rule is for traffic destined for 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 destination_type of this EgressSecurityRule.
Return type:str
icmp_options

Gets the icmp_options of this EgressSecurityRule. 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 EgressSecurityRule.
Return type:IcmpOptions
is_stateless

Gets the is_stateless of this EgressSecurityRule. 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 egress traffic allows TCP destination port 80, there should be an ingress 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 EgressSecurityRule.
Return type:bool
protocol

[Required] Gets the protocol of this EgressSecurityRule. 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 EgressSecurityRule.
Return type:str
tcp_options

Gets the tcp_options of this EgressSecurityRule. 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 EgressSecurityRule.
Return type:TcpOptions
udp_options

Gets the udp_options of this EgressSecurityRule. 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 EgressSecurityRule.
Return type:UdpOptions