diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/alerts.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/alerts.json index af231b53ccbd..ee6ef179e0a8 100644 --- a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/alerts.json +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/alerts.json @@ -129,6 +129,52 @@ } } } + }, + "patch": { + "x-ms-examples": { + "Update IoT Alert": { + "$ref": "./examples/Alerts/PatchAlert.json" + } + }, + "tags": [ + "IoT Security Alerts" + ], + "operationId": "IotAlerts_Patch", + "description": "Update an existing alert", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/1.0/types.json#/parameters/IotDefenderLocation" + }, + { + "$ref": "#/parameters/DeviceGroupName" + }, + { + "$ref": "#/parameters/AlertId" + }, + { + "$ref": "#/parameters/AlertPatchModel" + } + ], + "responses": { + "200": { + "description": "IoT alert", + "schema": { + "$ref": "#/definitions/AlertModel" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } } } }, @@ -174,6 +220,46 @@ } ] }, + "AlertSeverity": { + "type": "string", + "readOnly": false, + "description": "Alert Severity", + "enum": [ + "Informational", + "Low", + "Medium", + "High" + ], + "x-ms-enum": { + "name": "alertSeverity", + "modelAsString": true + } + }, + "AlertStatus": { + "type": "string", + "readOnly": false, + "description": "Alert Status", + "enum": [ + "New", + "InProgress", + "Closed" + ], + "x-ms-enum": { + "name": "alertStatus", + "modelAsString": true, + "values": [ + { + "value": "New" + }, + { + "value": "InProgress" + }, + { + "value": "Closed" + } + ] + } + }, "AlertPropertiesModel": { "type": "object", "description": "IoT alert properties", @@ -234,34 +320,10 @@ } }, "severity": { - "readOnly": true, "type": "string", "example": "Medium", - "description": "The severity of the alert", - "enum": [ - "Informational", - "Low", - "Medium", - "High" - ], - "x-ms-enum": { - "name": "alertSeverity", - "modelAsString": true, - "values": [ - { - "value": "Informational" - }, - { - "value": "Low" - }, - { - "value": "Medium" - }, - { - "value": "High" - } - ] - } + "$ref": "#/definitions/AlertSeverity", + "description": "The severity of the alert" }, "intent": { "readOnly": true, @@ -346,6 +408,36 @@ "type": "string", "example": "IoT Hub", "description": "The name of a component inside the product which generated the alert" + }, + "status": { + "type": "string", + "example": "New", + "description": "The status of the alert", + "$ref": "#/definitions/AlertStatus" + } + } + }, + "AlertPatchPropertiesModel": { + "type": "object", + "description": "IoT alert properties", + "properties": { + "properties": { + "type": "object", + "description": "IoT alert properties", + "properties": { + "severity": { + "type": "string", + "example": "Medium", + "description": "The severity of the alert", + "$ref": "#/definitions/AlertSeverity" + }, + "status": { + "type": "string", + "example": "New", + "description": "The status of the alert", + "$ref": "#/definitions/AlertStatus" + } + } } } } @@ -366,6 +458,16 @@ "description": "Alert Id", "type": "string", "x-ms-parameter-location": "method" + }, + "AlertPatchModel": { + "name": "alertPatchModel", + "in": "body", + "required": true, + "description": "IoT alert", + "schema": { + "$ref": "#/definitions/AlertPatchPropertiesModel" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/GetAlert.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/GetAlert.json index b5ef69c69c14..cff658f59a40 100644 --- a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/GetAlert.json +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/GetAlert.json @@ -34,7 +34,8 @@ }, "severity": "Medium", "intent": "PreAttack", - "productComponentName": "IoT Hub" + "productComponentName": "IoT Hub", + "status": "New" }, "systemData": { "createdBy": "string", diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/GetAlertList.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/GetAlertList.json index 2428839f23b9..a9661c519cf2 100644 --- a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/GetAlertList.json +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/GetAlertList.json @@ -35,7 +35,8 @@ }, "severity": "Medium", "intent": "PreAttack", - "productComponentName": "IoT Hub" + "productComponentName": "IoT Hub", + "status": "New" }, "systemData": { "createdBy": "string", diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/PatchAlert.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/PatchAlert.json new file mode 100644 index 000000000000..2d4a8c648457 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/examples/Alerts/PatchAlert.json @@ -0,0 +1,57 @@ +{ + "parameters": { + "api-version": "2021-07-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "iotDefenderLocation": "eastus", + "deviceGroupName": "default", + "alertId": "903e76ff-17eb-4bac-ac8a-2bc31ab68fd8", + "alertPatchModel": { + "properties": { + "severity": "Medium", + "status": "InProgress" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus/deviceGroups/default/alerts/903e76ff-17eb-4bac-ac8a-2bc31ab68fd8", + "name": "903e76ff-17eb-4bac-ac8a-2bc31ab68fd8", + "type": "Microsoft.IoTSecurity/alerts", + "properties": { + "systemAlertId": "903e76ff-17eb-4bac-ac8a-2bc31ab68fd8", + "azureResourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus/deviceGroups/default/devices/device-1", + "alertType": "IoT_PrivilegedContainer", + "startTimeUtc": "2020-05-13T06:32:25Z", + "endTimeUtc": "2020-05-13T06:32:25Z", + "entities": [ + { + "$id": "1", + "CommandLine": "docker run --privileged", + "Type": "process" + } + ], + "extendedProperties": { + "CommandLine": "docker run --privileged", + "User Name": "aUser", + "UserId": "", + "ParentProcessId": 1593, + "DeviceId": "device-1" + }, + "severity": "Medium", + "intent": "PreAttack", + "productComponentName": "IoT Hub", + "status": "InProgress" + }, + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-04-27T21:53:29.0928001Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-04-27T21:53:29.0928001Z" + } + } + } + } +}