AddNetworkSecurityGroupSecurityRules

post

/20160918/networkSecurityGroups/{network_security_group_id}/actions/addSecurityRules

Add one or more security rules to the specified network security group.

Request

Supported Media Types
Path Parameters
Body ()
Request with one or more security rules to be associated with the network security group.
Root Schema : AddNetworkSecurityGroupSecurityRulesDetails
Type: object
Show Source
Nested Schema : securityRules
Type: array
Minimum Number of Items: 1
Maximum Number of Items: 25
The NSG security rules to add.
Show Source
Nested Schema : AddSecurityRuleDetails
Type: object
A rule for allowing inbound (INGRESS) or outbound (EGRESS) IP packets.
Show Source
  • Minimum Length: 1
    Maximum Length: 255
    An optional description of your choice for the rule. Avoid entering confidential information.
  • This is the range of IP addresses that a packet originating from the instance can go to. The following values are allowed:
  • An IP address range in CIDR notation. For example: 192.168.1.0/24 or 2001:0db8:0123:45::/56
  • 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.
  • 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.
  • Allowed Values: [ "CIDR_BLOCK", "SERVICE_CIDR_BLOCK", "NETWORK_SECURITY_GROUP" ]
    Type of destination for the rule. This value is required if direction = EGRESS. The following values are allowed:
  • 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: [ "EGRESS", "INGRESS" ]
    Direction of the security rule. Set to EGRESS for rules to allow outbound IP packets, or INGRESS for rules to allow inbound IP packets.
  • IcmpOptions
    Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code as defined in: - [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) - [ICMPv6 Parameters](https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) 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.
  • 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. The default value is false, which means the rule is stateful and a corresponding rule is not necessary for bidirectional traffic.
  • The transport protocol. Specify either all or one of the following IPv4 protocol numbers: 1 - ICMP, 6 - TCP, 17 - UDP, and 58 - ICMPv6.
  • This is the range of IP addresses that a packet coming into the instance can come from. The following values are allowed:
  • An IP address range in CIDR notation. For example: 192.168.1.0/24 or 2001:0db8:0123:45::/56
  • 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.
  • 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.
  • Allowed Values: [ "CIDR_BLOCK", "SERVICE_CIDR_BLOCK", "NETWORK_SECURITY_GROUP" ]
    Type of source for the rule. This value is 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.
  • TcpOptions
    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.
  • UdpOptions
    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.
  • Nested Schema : IcmpOptions
    Type: object
    Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code as defined in: - [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) - [ICMPv6 Parameters](https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) 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.
    Show Source
    Nested Schema : TcpOptions
    Type: object
    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.
    Show Source
    Nested Schema : UdpOptions
    Type: object
    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.
    Show Source
    Nested Schema : PortRange
    Type: object
    Show Source
    • Minimum Value: 1
      Maximum Value: 65535
      The maximum port number, which must not be less than the minimum port number. To specify a single port number, set both the min and max to the same value.
    • Minimum Value: 1
      Maximum Value: 65535
      The minimum port number, which must not be greater than the maximum port number.
    Back to Top

    Response

    Supported Media Types

    200 Response

    The security rules were added.
    Headers
    • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
    Body ()
    Root Schema : AddedNetworkSecurityGroupSecurityRules
    Type: object
    Show Source
    Nested Schema : securityRules
    Type: array
    The NSG security rules that were added.
    Show Source
    • SecurityRule
      A security rule is a virtual firewall rule for the VNICs in a NetworkSecurityGroup. A rule can be for either inbound (direction= INGRESS) or outbound (direction= EGRESS) IP packets.
    Nested Schema : SecurityRule
    Type: object
    A security rule is a virtual firewall rule for the VNICs in a NetworkSecurityGroup. A rule can be for either inbound (direction= INGRESS) or outbound (direction= EGRESS) IP packets.
    Show Source
    • Minimum Length: 1
      Maximum Length: 255
      An optional description of your choice for the rule.
    • This is the range of IP addresses that a packet originating from the instance can go to. The following values are allowed:
    • An IP address range in CIDR notation. For example: 192.168.1.0/24 or 2001:0db8:0123:45::/56
    • 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.
    • 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.
  • Allowed Values: [ "CIDR_BLOCK", "SERVICE_CIDR_BLOCK", "NETWORK_SECURITY_GROUP" ]
    Type of destination for the rule. This value is required if direction = EGRESS. The following values are allowed:
  • 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: [ "EGRESS", "INGRESS" ]
    Direction of the security rule. Set to EGRESS for rules to allow outbound IP packets. Set to INGRESS for rules to allow inbound IP packets.
  • IcmpOptions
    Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code as defined in: - [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) - [ICMPv6 Parameters](https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) 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.
  • Minimum Length: 1
    Maximum Length: 255
    The OCID for the security rule. Specify this OCID when you want to update or delete the rule.
  • 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. The default value is false, which means the rule is stateful and a corresponding rule is not necessary for bidirectional traffic.
  • Whether the rule is valid. This value is True when the rule is first created. If the rule's source or destination is a network security group, the value changes to False if that network security group is deleted.
  • The transport protocol. Specify either all or an IPv4 protocol number as defined in [Protocol Numbers](http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). Only the following are supported: 1 - ICMP, 6 - TCP, 17 - UDP, and 58 - ICMPv6.
  • This is the range of IP addresses that a packet coming into the instance can come from. The following values are allowed:
  • An IP address range in CIDR notation. For example: 192.168.1.0/24 or 2001:0db8:0123:45::/56
  • 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.
  • 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.
  • Allowed Values: [ "CIDR_BLOCK", "SERVICE_CIDR_BLOCK", "NETWORK_SECURITY_GROUP" ]
    Type of source for the rule. This value is 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.
  • TcpOptions
    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.
  • The date and time the security rule was created. Format defined by [RFC3339](https://tools.ietf.org/html/rfc3339).
  • UdpOptions
    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.
  • Nested Schema : IcmpOptions
    Type: object
    Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code as defined in: - [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) - [ICMPv6 Parameters](https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) 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.
    Show Source
    Nested Schema : TcpOptions
    Type: object
    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.
    Show Source
    Nested Schema : UdpOptions
    Type: object
    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.
    Show Source
    Nested Schema : PortRange
    Type: object
    Show Source
    • Minimum Value: 1
      Maximum Value: 65535
      The maximum port number, which must not be less than the minimum port number. To specify a single port number, set both the min and max to the same value.
    • Minimum Value: 1
      Maximum Value: 65535
      The minimum port number, which must not be greater than the maximum port number.

    400 Response

    Bad Request
    Headers
    • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
    Body ()
    Root Schema : Error
    Type: object
    The properties that define an error.
    Show Source

    401 Response

    Unauthorized
    Headers
    • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
    Body ()
    Root Schema : Error
    Type: object
    The properties that define an error.
    Show Source

    404 Response

    Not Found
    Headers
    • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
    Body ()
    Root Schema : Error
    Type: object
    The properties that define an error.
    Show Source

    409 Response

    Conflict
    Headers
    • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
    Body ()
    Root Schema : Error
    Type: object
    The properties that define an error.
    Show Source

    500 Response

    Internal Server Error
    Headers
    • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
    Body ()
    Root Schema : Error
    Type: object
    The properties that define an error.
    Show Source

    Default Response

    An error has occurred.
    Headers
    • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
    Body ()
    Root Schema : Error
    Type: object
    The properties that define an error.
    Show Source
    Back to Top