Security Center icon

Security Center

API spec for Microsoft

COMMUNITYBEARER0 INSTALLS
OpenAPI Specificationv3.0
{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "management.azure.com",
  "info": {
    "description": "API spec for Microsoft.Security (Azure Security Center) resource provider",
    "title": "Security Center",
    "version": "2017-08-01-preview",
    "x-apisguru-categories": [
      "cloud"
    ],
    "x-logo": {
      "url": "https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png"
    },
    "x-origin": [
      {
        "format": "swagger",
        "url": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/compliances.json",
        "version": "2.0"
      }
    ],
    "x-providerName": "azure.com",
    "x-serviceName": "security-compliances",
    "x-tags": [
      "Azure",
      "Microsoft"
    ]
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "azure_auth": {
      "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
      "description": "Azure Active Directory OAuth2 Flow",
      "flow": "implicit",
      "scopes": {
        "user_impersonation": "impersonate your user account"
      },
      "type": "oauth2"
    }
  },
  "security": [
    {
      "azure_auth": [
        "user_impersonation"
      ]
    }
  ],
  "parameters": {
    "ComplianceName": {
      "description": "name of the Compliance",
      "in": "path",
      "name": "complianceName",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    }
  },
  "paths": {
    "/{scope}/providers/Microsoft.Security/compliances": {
      "get": {
        "description": "The Compliance scores of the specific management group.",
        "operationId": "Compliances_List",
        "parameters": [
          {
            "description": "API version for the operation",
            "in": "query",
            "name": "api-version",
            "required": true,
            "type": "string"
          },
          {
            "description": "Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName).",
            "in": "path",
            "name": "scope",
            "required": true,
            "type": "string",
            "x-ms-parameter-location": "method"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/ComplianceList"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "description": "Error response structure.",
              "properties": {
                "error": {
                  "description": "Error details.",
                  "properties": {
                    "code": {
                      "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically.",
                      "readOnly": true,
                      "type": "string"
                    },
                    "message": {
                      "description": "A message describing the error, intended to be suitable for display in a user interface.",
                      "readOnly": true,
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "x-ms-external": true
                }
              },
              "type": "object",
              "x-ms-external": true
            }
          }
        },
        "tags": [
          "Compliances"
        ],
        "x-ms-examples": {
          "Get security compliance data over time": {
            "parameters": {
              "api-version": "2017-08-01-preview",
              "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-01Z",
                      "name": "2018-01-01Z",
                      "properties": {
                        "assessmentResult": [
                          {
                            "percentage": 77.77777777777779,
                            "segmentType": "Compliant"
                          }
                        ],
                        "assessmentTimestampUtcDate": "2018-01-01T00:00:00Z",
                        "resourceCount": 18
                      },
                      "type": "Microsoft.Security/compliances"
                    },
                    {
                      "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-02Z",
                      "name": "2018-01-02Z",
                      "properties": {
                        "assessmentResult": [
                          {
                            "percentage": 94.44444444444444,
                            "segmentType": "Compliant"
                          }
                        ],
                        "assessmentTimestampUtcDate": "2018-01-02T00:00:00Z",
                        "resourceCount": 18
                      },
                      "type": "Microsoft.Security/compliances"
                    },
                    {
                      "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-03Z",
                      "name": "2018-01-03Z",
                      "properties": {
                        "assessmentResult": [
                          {
                            "percentage": 100,
                            "segmentType": "Compliant"
                          }
                        ],
                        "assessmentTimestampUtcDate": "2018-01-03T00:00:00Z",
                        "resourceCount": 18
                      },
                      "type": "Microsoft.Security/compliances"
                    }
                  ]
                }
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/{scope}/providers/Microsoft.Security/compliances/{complianceName}": {
      "get": {
        "description": "Details of a specific Compliance.",
        "operationId": "Compliances_Get",
        "parameters": [
          {
            "description": "API version for the operation",
            "in": "query",
            "name": "api-version",
            "required": true,
            "type": "string"
          },
          {
            "description": "Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName).",
            "in": "path",
            "name": "scope",
            "required": true,
            "type": "string",
            "x-ms-parameter-location": "method"
          },
          {
            "$ref": "#/parameters/ComplianceName"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/Compliance"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "description": "Error response structure.",
              "properties": {
                "error": {
                  "description": "Error details.",
                  "properties": {
                    "code": {
                      "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically.",
                      "readOnly": true,
                      "type": "string"
                    },
                    "message": {
                      "description": "A message describing the error, intended to be suitable for display in a user interface.",
                      "readOnly": true,
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "x-ms-external": true
                }
              },
              "type": "object",
              "x-ms-external": true
            }
          }
        },
        "tags": [
          "Compliances"
        ],
        "x-ms-examples": {
          "Get security compliance data for a day": {
            "parameters": {
              "api-version": "2017-08-01-preview",
              "complianceName": "2018-01-01Z",
              "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"
            },
            "responses": {
              "200": {
                "body": {
                  "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-01Z",
                  "name": "2018-01-01Z",
                  "properties": {
                    "assessmentResult": [
                      {
                        "percentage": 77.77777777777779,
                        "segmentType": "Compliant"
                      }
                    ],
                    "assessmentTimestampUtcDate": "2018-01-01T00:00:00Z",
                    "resourceCount": 18
                  },
                  "type": "Microsoft.Security/compliances"
                }
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Compliance": {
      "allOf": [
        {
          "description": "Describes an Azure resource.",
          "properties": {
            "id": {
              "description": "Resource Id",
              "readOnly": true,
              "type": "string"
            },
            "name": {
              "description": "Resource name",
              "readOnly": true,
              "type": "string"
            },
            "type": {
              "description": "Resource type",
              "readOnly": true,
              "type": "string"
            }
          },
          "type": "object",
          "x-ms-azure-resource": true
        }
      ],
      "description": "Compliance of a scope",
      "properties": {
        "properties": {
          "$ref": "#/definitions/ComplianceProperties",
          "description": "Compliance data",
          "x-ms-client-flatten": true
        }
      },
      "readOnly": true,
      "type": "object"
    },
    "ComplianceList": {
      "description": "List of Compliance objects response",
      "properties": {
        "nextLink": {
          "description": "The URI to fetch the next page.",
          "readOnly": true,
          "type": "string"
        },
        "value": {
          "description": "List of Compliance objects",
          "items": {
            "$ref": "#/definitions/Compliance"
          },
          "type": "array"
        }
      },
      "readOnly": true,
      "type": "object"
    },
    "ComplianceProperties": {
      "description": "The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy Definitions applicable to a given resource.",
      "properties": {
        "assessmentResult": {
          "description": "An array of segment, which is the actually the compliance assessment.",
          "items": {
            "$ref": "#/definitions/ComplianceSegment"
          },
          "readOnly": true,
          "type": "array"
        },
        "assessmentTimestampUtcDate": {
          "description": "The timestamp when the Compliance calculation was conducted.",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "resourceCount": {
          "description": "The resource count of the given subscription for which the Compliance calculation was conducted (needed for Management Group Compliance calculation).",
          "readOnly": true,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "ComplianceSegment": {
      "description": "A segment of a compliance assessment.",
      "properties": {
        "percentage": {
          "description": "The size (%) of the segment.",
          "format": "double",
          "readOnly": true,
          "type": "number"
        },
        "segmentType": {
          "description": "The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc.",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}