AddSecurityRuleDetails

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

Bases: object

A rule for allowing inbound (INGRESS) or outbound (EGRESS) IP packets.

Attributes

DESTINATION_TYPE_CIDR_BLOCK A constant which can be used with the destination_type property of a AddSecurityRuleDetails.
DESTINATION_TYPE_NETWORK_SECURITY_GROUP A constant which can be used with the destination_type property of a AddSecurityRuleDetails.
DESTINATION_TYPE_SERVICE_CIDR_BLOCK A constant which can be used with the destination_type property of a AddSecurityRuleDetails.
DIRECTION_EGRESS A constant which can be used with the direction property of a AddSecurityRuleDetails.
DIRECTION_INGRESS A constant which can be used with the direction property of a AddSecurityRuleDetails.
SOURCE_TYPE_CIDR_BLOCK A constant which can be used with the source_type property of a AddSecurityRuleDetails.
SOURCE_TYPE_NETWORK_SECURITY_GROUP A constant which can be used with the source_type property of a AddSecurityRuleDetails.
SOURCE_TYPE_SERVICE_CIDR_BLOCK A constant which can be used with the source_type property of a AddSecurityRuleDetails.
description Gets the description of this AddSecurityRuleDetails.
destination Gets the destination of this AddSecurityRuleDetails.
destination_type Gets the destination_type of this AddSecurityRuleDetails.
direction [Required] Gets the direction of this AddSecurityRuleDetails.
icmp_options Gets the icmp_options of this AddSecurityRuleDetails.
is_stateless Gets the is_stateless of this AddSecurityRuleDetails.
protocol [Required] Gets the protocol of this AddSecurityRuleDetails.
source Gets the source of this AddSecurityRuleDetails.
source_type Gets the source_type of this AddSecurityRuleDetails.
tcp_options Gets the tcp_options of this AddSecurityRuleDetails.
udp_options Gets the udp_options of this AddSecurityRuleDetails.

Methods

__init__(**kwargs) Initializes a new AddSecurityRuleDetails object with values from keyword arguments.
DESTINATION_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'

A constant which can be used with the destination_type property of a AddSecurityRuleDetails. This constant has a value of “CIDR_BLOCK”

DESTINATION_TYPE_NETWORK_SECURITY_GROUP = 'NETWORK_SECURITY_GROUP'

A constant which can be used with the destination_type property of a AddSecurityRuleDetails. This constant has a value of “NETWORK_SECURITY_GROUP”

DESTINATION_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'

A constant which can be used with the destination_type property of a AddSecurityRuleDetails. This constant has a value of “SERVICE_CIDR_BLOCK”

DIRECTION_EGRESS = 'EGRESS'

A constant which can be used with the direction property of a AddSecurityRuleDetails. This constant has a value of “EGRESS”

DIRECTION_INGRESS = 'INGRESS'

A constant which can be used with the direction property of a AddSecurityRuleDetails. This constant has a value of “INGRESS”

SOURCE_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'

A constant which can be used with the source_type property of a AddSecurityRuleDetails. This constant has a value of “CIDR_BLOCK”

SOURCE_TYPE_NETWORK_SECURITY_GROUP = 'NETWORK_SECURITY_GROUP'

A constant which can be used with the source_type property of a AddSecurityRuleDetails. This constant has a value of “NETWORK_SECURITY_GROUP”

SOURCE_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'

A constant which can be used with the source_type property of a AddSecurityRuleDetails. This constant has a value of “SERVICE_CIDR_BLOCK”

__init__(**kwargs)

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

Parameters:
  • description (str) – The value to assign to the description property of this AddSecurityRuleDetails.
  • destination (str) – The value to assign to the destination property of this AddSecurityRuleDetails.
  • destination_type (str) – The value to assign to the destination_type property of this AddSecurityRuleDetails. Allowed values for this property are: “CIDR_BLOCK”, “SERVICE_CIDR_BLOCK”, “NETWORK_SECURITY_GROUP”
  • direction (str) – The value to assign to the direction property of this AddSecurityRuleDetails. Allowed values for this property are: “EGRESS”, “INGRESS”
  • icmp_options (oci.core.models.IcmpOptions) – The value to assign to the icmp_options property of this AddSecurityRuleDetails.
  • is_stateless (bool) – The value to assign to the is_stateless property of this AddSecurityRuleDetails.
  • protocol (str) – The value to assign to the protocol property of this AddSecurityRuleDetails.
  • source (str) – The value to assign to the source property of this AddSecurityRuleDetails.
  • source_type (str) – The value to assign to the source_type property of this AddSecurityRuleDetails. Allowed values for this property are: “CIDR_BLOCK”, “SERVICE_CIDR_BLOCK”, “NETWORK_SECURITY_GROUP”
  • tcp_options (oci.core.models.TcpOptions) – The value to assign to the tcp_options property of this AddSecurityRuleDetails.
  • udp_options (oci.core.models.UdpOptions) – The value to assign to the udp_options property of this AddSecurityRuleDetails.
description

Gets the description of this AddSecurityRuleDetails. An optional description of your choice for the rule. Avoid entering confidential information.

Returns:The description of this AddSecurityRuleDetails.
Return type:str
destination

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

Allowed values:

  • An IP address range in CIDR notation. For example: 192.168.1.0/24 or 2001:0db8:0123:45::/56 IPv6 addressing is supported for all commercial and government regions. See IPv6 Addresses.
  • The cidrBlock value for a Service, if you’re setting up a security rule for traffic destined for a particular Service through a service gateway. For example: oci-phx-objectstorage.
  • The OCID of a NetworkSecurityGroup in the same VCN. The value can be the NSG that the rule belongs to if the rule’s intent is to control traffic between VNICs in the same NSG.
Returns:The destination of this AddSecurityRuleDetails.
Return type:str
destination_type

Gets the destination_type of this AddSecurityRuleDetails. Type of destination for the rule. Required if direction = EGRESS.

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).
  • NETWORK_SECURITY_GROUP: If the rule’s destination is the OCID of a NetworkSecurityGroup.

Allowed values for this property are: “CIDR_BLOCK”, “SERVICE_CIDR_BLOCK”, “NETWORK_SECURITY_GROUP”

Returns:The destination_type of this AddSecurityRuleDetails.
Return type:str
direction

[Required] Gets the direction of this AddSecurityRuleDetails. Direction of the security rule. Set to EGRESS for rules to allow outbound IP packets, or INGRESS for rules to allow inbound IP packets.

Allowed values for this property are: “EGRESS”, “INGRESS”

Returns:The direction of this AddSecurityRuleDetails.
Return type:str
icmp_options

Gets the icmp_options of this AddSecurityRuleDetails.

Returns:The icmp_options of this AddSecurityRuleDetails.
Return type:oci.core.models.IcmpOptions
is_stateless

Gets the is_stateless of this AddSecurityRuleDetails. 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 AddSecurityRuleDetails.
Return type:bool
protocol

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

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

Allowed values:

  • An IP address range in CIDR notation. For example: 192.168.1.0/24 or 2001:0db8:0123:45::/56 IPv6 addressing is supported for all commercial and government regions. See IPv6 Addresses.
  • The cidrBlock value for a Service, if you’re setting up a security rule for traffic coming from a particular Service through a service gateway. For example: oci-phx-objectstorage.
  • The OCID of a NetworkSecurityGroup in the same VCN. The value can be the NSG that the rule belongs to if the rule’s intent is to control traffic between VNICs in the same NSG.
Returns:The source of this AddSecurityRuleDetails.
Return type:str
source_type

Gets the source_type of this AddSecurityRuleDetails. Type of source for the rule. Required if direction = INGRESS.

  • 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).
  • NETWORK_SECURITY_GROUP: If the rule’s source is the OCID of a NetworkSecurityGroup.

Allowed values for this property are: “CIDR_BLOCK”, “SERVICE_CIDR_BLOCK”, “NETWORK_SECURITY_GROUP”

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

Gets the tcp_options of this AddSecurityRuleDetails.

Returns:The tcp_options of this AddSecurityRuleDetails.
Return type:oci.core.models.TcpOptions
udp_options

Gets the udp_options of this AddSecurityRuleDetails.

Returns:The udp_options of this AddSecurityRuleDetails.
Return type:oci.core.models.UdpOptions