ALIYUN::ThreatDetection::ImageEventOperation

更新时间:
复制为 MD 格式

ALIYUN::ThreatDetection::ImageEventOperation类型用于增加镜像告警处置规则。

语法

{
  "Type": "ALIYUN::ThreatDetection::ImageEventOperation",
  "Properties": {
    "Conditions": Map,
    "EventType": String,
    "OperationCode": String,
    "EventKey": String,
    "EventName": String,
    "Note": String,
    "Scenarios": Map,
    "Source": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Conditions

Map

规则条件。

JSON 格式,key 取值:

  • condition:匹配条件。

  • type:匹配类型。

  • value:匹配值。

EventType

String

镜像事件类型。

取值:

  • sensitiveFile

  • maliciousFile

  • buildRisk

OperationCode

String

事件操作码。

取值:

  • whitelist

EventKey

String

告警项的关键字。

EventName

String

告警项的名称。

Note

String

要添加的备注。

Scenarios

Map

规则的应用范围。

JSON 格式,key 取值:

  • type:范围类型。

  • value:范围值。

示例:{"type": "repo", "value": "test-aaa/shenzhen-repo-01"}

Source

String

白名单来源。

取值:

  • image:镜像。

  • agentless:无代理检测。

返回值

Fn::GetAtt

  • ImageEventOperationId:资源的第一个ID。

  • EventType:镜像事件类型。

  • Note:备注。

  • OperationCode:事件操作码。

  • EventKey:镜像事件关键字。

  • Scenarios:事件场景。

  • EventName:镜像事件名称。

  • Source:白名单来源。

  • Conditions:规则条件。以JSON格式指定值。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Note:
    Type: String
    Description:
      en: The remarks that you want to add.
    Default: Null
    Required: false
  EventType:
    Type: String
    Description:
      en: Image Event Type.
    AllowedValues:
      - sensitiveFile
      - maliciousFile
      - buildRisk
    Required: true
  EventName:
    Type: String
    Description:
      en: The name of the alert item.
    Default: Null
    Required: false
  Source:
    Type: String
    Description:
      en: |-
        The source of the whitelist. Valid values:
        *   **default**: image.
        *   **agentless**: agentless detection.
    AllowedValues:
      - agentless
      - default
    Default: Null
    Required: false
  EventKey:
    Type: String
    Description:
      en: The keyword of the alert item.
    Default: Null
    Required: false
  Scenarios:
    Description:
      en: |-
        The application scope of the rule. The value is in the JSON format. Valid values of keys:
        type
        value
        Example: {"type": "repo", "value": "test-aaa/shenzhen-repo-01"}
    Required: false
    Default: Null
    Type: Json
  Conditions:
    Description:
      en: |-
        The rule conditions. Specify a value in the JSON format. You can specify the following keys:
        *   **condition**: the matching condition.
        *   **type**: the matching type.
        *   **value**: the matching value.
    Required: true
    Type: Json
  OperationCode:
    Type: String
    Description:
      en: Event Operation Code.
    AllowedValues:
      - whitelist
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::ThreatDetection::ImageEventOperation
    Properties:
      Note:
        Ref: Note
      EventType:
        Ref: EventType
      EventName:
        Ref: EventName
      Source:
        Ref: Source
      EventKey:
        Ref: EventKey
      Scenarios:
        Ref: Scenarios
      Conditions:
        Ref: Conditions
      OperationCode:
        Ref: OperationCode
Outputs:
  Note:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Note
    Description: The remarks.
  ImageEventOperationId:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ImageEventOperationId
    Description: The first ID of the resource.
  EventType:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EventType
    Description: Image Event Type.
  EventName:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EventName
    Description: Image Event Name.
  Source:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Source
    Description: The source of the whitelist.
  EventKey:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EventKey
    Description: Image Event Key.
  Scenarios:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Scenarios
    Description: Event Scenarios.
  Conditions:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Conditions
    Description: The rule conditions. Specify a value in the JSON format.
  OperationCode:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - OperationCode
    Description: Event Operation Code.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Note": {
      "Type": "String",
      "Description": {
        "en": "The remarks that you want to add."
      },
      "Default": null,
      "Required": false
    },
    "EventType": {
      "Type": "String",
      "Description": {
        "en": "Image Event Type."
      },
      "AllowedValues": [
        "sensitiveFile",
        "maliciousFile",
        "buildRisk"
      ],
      "Required": true
    },
    "EventName": {
      "Type": "String",
      "Description": {
        "en": "The name of the alert item."
      },
      "Default": null,
      "Required": false
    },
    "Source": {
      "Type": "String",
      "Description": {
        "en": "The source of the whitelist. Valid values:\n*   **default**: image.\n*   **agentless**: agentless detection."
      },
      "AllowedValues": [
        "agentless",
        "default"
      ],
      "Default": null,
      "Required": false
    },
    "EventKey": {
      "Type": "String",
      "Description": {
        "en": "The keyword of the alert item."
      },
      "Default": null,
      "Required": false
    },
    "Scenarios": {
      "Description": {
        "en": "The application scope of the rule. The value is in the JSON format. Valid values of keys:\ntype\nvalue\nExample: {\"type\": \"repo\", \"value\": \"test-aaa/shenzhen-repo-01\"}"
      },
      "Required": false,
      "Default": null,
      "Type": "Json"
    },
    "Conditions": {
      "Description": {
        "en": "The rule conditions. Specify a value in the JSON format. You can specify the following keys:\n*   **condition**: the matching condition.\n*   **type**: the matching type.\n*   **value**: the matching value."
      },
      "Required": true,
      "Type": "Json"
    },
    "OperationCode": {
      "Type": "String",
      "Description": {
        "en": "Event Operation Code."
      },
      "AllowedValues": [
        "whitelist"
      ],
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ThreatDetection::ImageEventOperation",
      "Properties": {
        "Note": {
          "Ref": "Note"
        },
        "EventType": {
          "Ref": "EventType"
        },
        "EventName": {
          "Ref": "EventName"
        },
        "Source": {
          "Ref": "Source"
        },
        "EventKey": {
          "Ref": "EventKey"
        },
        "Scenarios": {
          "Ref": "Scenarios"
        },
        "Conditions": {
          "Ref": "Conditions"
        },
        "OperationCode": {
          "Ref": "OperationCode"
        }
      }
    }
  },
  "Outputs": {
    "Note": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Note"
        ]
      },
      "Description": "The remarks."
    },
    "ImageEventOperationId": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ImageEventOperationId"
        ]
      },
      "Description": "The first ID of the resource."
    },
    "EventType": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EventType"
        ]
      },
      "Description": "Image Event Type."
    },
    "EventName": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EventName"
        ]
      },
      "Description": "Image Event Name."
    },
    "Source": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Source"
        ]
      },
      "Description": "The source of the whitelist."
    },
    "EventKey": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EventKey"
        ]
      },
      "Description": "Image Event Key."
    },
    "Scenarios": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Scenarios"
        ]
      },
      "Description": "Event Scenarios."
    },
    "Conditions": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Conditions"
        ]
      },
      "Description": "The rule conditions. Specify a value in the JSON format."
    },
    "OperationCode": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "OperationCode"
        ]
      },
      "Description": "Event Operation Code."
    }
  }
}