文档

ALIYUN::VPC::TrafficMirrorFilter

更新时间:

ALIYUN::VPC::TrafficMirrorFilter类型用于创建流量镜像筛选条件。

语法

{
  "Type": "ALIYUN::VPC::TrafficMirrorFilter",
  "Properties": {
    "TrafficMirrorFilterDescription": String,
    "EgressRules": List,
    "TrafficMirrorFilterName": String,
    "IngressRules": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

TrafficMirrorFilterDescription

String

流量镜像筛选条件的描述信息。

描述长度为1~256个字符,不能以http://https://开头。

EgressRules

List

出方向规则详情。

更多信息,请参见EgressRules属性

TrafficMirrorFilterName

String

流量镜像筛选条件的名称。

名称长度为1~128个字符,不能以http://https://开头。

IngressRules

List

入方向规则详情。

更多信息,请参见IngressRules属性

EgressRules语法

"EgressRules": [
  {
    "DestinationPortRange": String,
    "Action": String,
    "SourcePortRange": String,
    "Priority": Integer,
    "SourceCidrBlock": String,
    "DestinationCidrBlock": String,
    "Protocol": String
  }
]

EgressRules属性

属性名称

类型

必须

允许更新

描述

约束

DestinationPortRange

String

出方向规则网络流量的目的端口范围。

端口范围为1~65535。

使用正斜线(/)隔开起始端口和终止端口,格式为1/200、80/80。

其中-1/-1不能单独设置,代表不限制端口。

说明

当EgressRules中的Protocol取值为ALL或ICMP时,该参数无需配置,表示不限制端口。

Action

String

出方向规则的采集策略。

取值:

  • accept:采集网络流量。

  • drop:不采集网络流量。

SourcePortRange

String

出方向规则网络流量的源端口范围。

端口范围为1~65535。

使用正斜线(/)隔开起始端口和终止端口,格式为1/200、80/80。

其中-1/-1不能单独设置,代表不限制端口。

说明

当EgressRules中的Protocol取值为ALL或ICMP时,该参数无需配置,表示不限制端口。

Priority

Integer

出方向规则的优先级。

数字越小,优先级越高。

一个筛选条件最多可配置10条出方向规则。

SourceCidrBlock

String

出方向规则网络流量的源地址网段。

DestinationCidrBlock

String

出方向规则网络流量的目的地址网段。

Protocol

String

出方向需要镜像的网络流量使用的协议类型。

取值:

  • ALL:所有协议。

  • ICMP:网络控制报文协议。

  • TCP:传输控制协议。

  • UDP:用户数据报协议。

IngressRules语法

"IngressRules": [
  {
    "DestinationPortRange": String,
    "Action": String,
    "SourcePortRange": String,
    "Priority": Integer,
    "SourceCidrBlock": String,
    "DestinationCidrBlock": String,
    "Protocol": String
  }
]

IngressRules属性

属性名称

类型

必须

允许更新

描述

约束

DestinationPortRange

String

入方向规则网络流量的目的端口范围。

端口范围为1~65535。

使用正斜线(/)隔开起始端口和终止端口,格式为1/200、80/80。

说明

当IngressRules中的Protocol取值为ALL或ICMP时,该参数无需设置,表示不限制端口。

Action

String

入方向规则的采集策略。

取值:

  • accept:采集网络流量。

  • drop:不采集网络流量。

SourcePortRange

String

入方向规则网络流量的源端口范围。

端口范围为1~65535。

使用正斜线(/)隔开起始端口和终止端口,格式为1/200、80/80。

说明

当IngressRules中的Protocol取值为ALL或ICMP时,该参数无需配置,表示不限制端口。

Priority

Integer

入方向规则的优先级。

数字越小,优先级越高。

一个筛选条件最多可配置10条入方向规则。

SourceCidrBlock

String

入方向规则网络流量的源地址网段。

DestinationCidrBlock

String

入方向规则网络流量的目的地址网段。

Protocol

String

入方向需要镜像的网络流量使用的协议类型。

取值:

  • ALL:所有协议。

  • ICMP:网络控制报文协议。

  • TCP:传输控制协议。

  • UDP:用户数据报协议。

返回值

Fn::GetAtt

  • TrafficMirrorFilterDescription:流量镜像筛选条件的描述信息。

  • EgressRules:出方向规则详情。

  • TrafficMirrorFilterId:流量镜像筛选条件的实例ID。

  • TrafficMirrorFilterName:流量镜像筛选条件的实例名称。

  • IngressRules:入方向规则详情。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      ExtensionResource:
        Type: ALIYUN::VPC::TrafficMirrorFilter
        Properties:
          EgressRules:
            - DestinationPortRange: 22/40
              Action: accept
              SourcePortRange: 22/40
              Priority: 1
              SourceCidrBlock: 10.0.0.0/24
              DestinationCidrBlock: 10.0.0.0/24
              Protocol: TCP
          TrafficMirrorFilterName: TestTrafficMirrorFilterName
          IngressRules:
            - Action: accept
              SourceCidrBlock: 10.0.0.0/24
              Protocol: TCP
              DestinationPortRange: 80/120
              Priority: 1
              DestinationCidrBlock: 10.0.0.0/24
              SourcePortRange: 80/120
    Outputs:
      TrafficMirrorFilterDescription:
        Description: The description of the filter.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - TrafficMirrorFilterDescription
      EgressRules:
        Description: Egress rules.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - EgressRules
      TrafficMirrorFilterId:
        Description: The ID of the filter.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - TrafficMirrorFilterId
      TrafficMirrorFilterName:
        Description: The name of the filter.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - TrafficMirrorFilterName
      IngressRules:
        Description: Ingress rules.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - IngressRules
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "ExtensionResource": {
          "Type": "ALIYUN::VPC::TrafficMirrorFilter",
          "Properties": {
            "EgressRules": [
              {
                "DestinationPortRange": "22/40",
                "Action": "accept",
                "SourcePortRange": "22/40",
                "Priority": 1,
                "SourceCidrBlock": "10.0.0.0/24",
                "DestinationCidrBlock": "10.0.0.0/24",
                "Protocol": "TCP"
              }
            ],
            "TrafficMirrorFilterName": "TestTrafficMirrorFilterName",
            "IngressRules": [
              {
                "Action": "accept",
                "SourceCidrBlock": "10.0.0.0/24",
                "Protocol": "TCP",
                "DestinationPortRange": "80/120",
                "Priority": 1,
                "DestinationCidrBlock": "10.0.0.0/24",
                "SourcePortRange": "80/120"
              }
            ]
          }
        }
      },
      "Outputs": {
        "TrafficMirrorFilterDescription": {
          "Description": "The description of the filter.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "TrafficMirrorFilterDescription"
            ]
          }
        },
        "EgressRules": {
          "Description": "Egress rules.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "EgressRules"
            ]
          }
        },
        "TrafficMirrorFilterId": {
          "Description": "The ID of the filter.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "TrafficMirrorFilterId"
            ]
          }
        },
        "TrafficMirrorFilterName": {
          "Description": "The name of the filter.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "TrafficMirrorFilterName"
            ]
          }
        },
        "IngressRules": {
          "Description": "Ingress rules.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "IngressRules"
            ]
          }
        }
      }
    }
  • 本页导读 (1)
文档反馈