Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Data Connectors Check Requirements to security insights #8020

Merged
merged 17 commits into from
Jan 23, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,72 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements": {
"post": {
"x-ms-examples": {
"Check requirements for TI.": {
"$ref": "./examples/dataConnectors/CheckRequirementsThreatIntelligence.json"
},
"Check requirements for AAD.": {
"$ref": "./examples/dataConnectors/CheckRequirementsAzureActiveDirectory.json"
},
"Check requirements for AAD - no license.": {
"$ref": "./examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoLicense.json"
},
"Check requirements for AAD - no authorization.": {
"$ref": "./examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json"
},
"Check requirements for ASC.": {
"$ref": "./examples/dataConnectors/CheckRequirementsAzureSecurityCenter.json"
},
"Check requirements for Mcas.": {
"$ref": "./examples/dataConnectors/CheckRequirementsMicrosoftCloudAppSecurity.json"
},
"Check requirements for Mdatp.": {
"$ref": "./examples/dataConnectors/CheckRequirementsMdatp.json"
}
},
"tags": [
"Check Data Connector Requirements"
],
"description": "Get requirements state for a data connector type.",
"operationId": "listDataConnectorRequirements",
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/SubscriptionId"
},
{
"$ref": "#/parameters/ResourceGroupName"
},
{
"$ref": "#/parameters/WorkspaceName"
},
{
"$ref": "#/parameters/OperationalInsightsResourceProvider"
},
{
"$ref": "#/parameters/DataConnectorsCheckRequirementsBody"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/DataConnectorRequirementsState"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities": {
"get": {
"x-ms-examples": {
Expand Down Expand Up @@ -2425,6 +2491,22 @@
"description": "AAD (Azure Active Directory) data connector properties.",
"type": "object"
},
"AADCheckRequirements": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AADCheckRequirements [](start = 5, length = 20)

you may want to use discriminator pattern. i suppose we want the clients to use any of these objects (that inherit from DataConnectorsCheckRequirements) with the newly added POST.
This object has additional property of DataConnectorTenantId

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not the only thing that inherits from DataConnectorsCheckRequirements that has DataConnectorTenantId.
I added discriminators to anything that inherits from DataConnectorsCheckRequirements. Thanks

"allOf": [
{
"$ref": "#/definitions/DataConnectorsCheckRequirements"
},
{
"$ref": "#/definitions/DataConnectorTenantId"
}
],
"description": "AAD (Azure Active Directory) requirements check properties.",
"type": "object",
"discriminator": "kind",
"required": [
"kind"
]
},
"AATPDataConnector": {
"allOf": [
{
Expand Down Expand Up @@ -2454,6 +2536,22 @@
"description": "AATP (Azure Advanced Threat Protection) data connector properties.",
"type": "object"
},
"AATPCheckRequirements": {
"allOf": [
{
"$ref": "#/definitions/DataConnectorsCheckRequirements"
},
{
"$ref": "#/definitions/DataConnectorTenantId"
}
],
"description": "AATP (Azure Advanced Threat Protection) requirements check properties.",
"type": "object",
"discriminator": "kind",
"required": [
"kind"
]
},
"ASCDataConnector": {
"allOf": [
{
Expand Down Expand Up @@ -2486,6 +2584,25 @@
},
"type": "object"
},
"ASCCheckRequirements": {
"description": "ASC (Azure Security Center) requirements check properties.",
"allOf": [
{
"$ref": "#/definitions/DataConnectorsCheckRequirements"
}
],
"properties": {
"subscriptionId": {
"description": "The subscription id to connect to, and get the data from.",
"type": "string"
}
},
"type": "object",
"discriminator": "kind",
"required": [
"kind"
]
},
"AccountEntity": {
"allOf": [
{
Expand Down Expand Up @@ -2657,7 +2774,10 @@
],
"description": "The aggregation.",
"discriminator": "kind",
"type": "object"
"type": "object",
"required": [
"kind"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this is already being enforced at server level and even discriminator pattern may not work. hope that is the case.
otherwise, adding new required property is a breaking change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added these because a test wouldn't pass, there was an error saying a discriminator must be required.
It is enforced in the server level as well.
What do you mean by "even discriminator pattern may not work" ?

},
"AggregationsKind": {
"description": "Describes an Azure resource with kind.",
Expand Down Expand Up @@ -2687,7 +2807,10 @@
],
"description": "Alert rule.",
"discriminator": "kind",
"type": "object"
"type": "object",
"required": [
"kind"
]
},
"AlertRuleKind": {
"description": "Describes an Azure resource with kind.",
Expand Down Expand Up @@ -2730,7 +2853,10 @@
],
"description": "Alert rule template.",
"discriminator": "kind",
"type": "object"
"type": "object",
"required": [
"kind"
]
},
"AlertRuleTemplatePropertiesBase": {
"description": "Base alert rule template property bag.",
Expand Down Expand Up @@ -2966,6 +3092,19 @@
},
"type": "object"
},
"AwsCloudTrailCheckRequirements": {
"allOf": [
{
"$ref": "#/definitions/DataConnectorsCheckRequirements"
}
],
"description": "Amazon Web Services CloudTrail requirements check properties.",
"type": "object",
"discriminator": "kind",
"required": [
"kind"
]
},
"AzureResourceEntity": {
"allOf": [
{
Expand Down Expand Up @@ -3795,7 +3934,62 @@
],
"description": "Data connector.",
"discriminator": "kind",
"type": "object"
"type": "object",
"required": [
"kind"
]
},
"DataConnectorsCheckRequirements": {
"allOf": [
{
"$ref": "#/definitions/DataConnectorKind"
}
],
"description": "Data connector requirements properties."
},
"DataConnectorAuthorizationState": {
"description": "Describes the state of user's authorization for a connector kind.",
"enum": [
"Valid",
"Invalid"
],
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "DataConnectorAuthorizationState",
"values": [
{
"value": "Valid"
},
{
"value": "Invalid"
}
]
}
},
"DataConnectorLicenseState": {
"description": "Describes the state of user's license for a connector kind.",
"enum": [
"Valid",
"Invalid",
"Unknown"
],
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "DataConnectorLicenseState",
"values": [
{
"value": "Valid"
},
{
"value": "Invalid"
},
{
"value": "Unknown"
}
]
}
},
"DataConnectorDataTypeCommon": {
"description": "Common field for data type in data connectors.",
Expand Down Expand Up @@ -3910,6 +4104,20 @@
},
"type": "object"
},
"DataConnectorRequirementsState": {
"description": "Data connector requirements status.",
"properties": {
"authorizationState": {
"description": "Authorization state for this connector",
"$ref": "#/definitions/DataConnectorAuthorizationState"
},
"licenseState": {
"description": "License state for this connector",
"$ref": "#/definitions/DataConnectorLicenseState"
}
},
"type": "object"
},
"DataConnectorTenantId": {
"description": "Properties data connector on tenant level.",
"properties": {
Expand Down Expand Up @@ -3993,7 +4201,10 @@
],
"description": "Specific entity.",
"discriminator": "kind",
"type": "object"
"type": "object",
"required": [
"kind"
]
},
"EntityCommonProperties": {
"description": "Entity common property bag.",
Expand Down Expand Up @@ -4853,6 +5064,22 @@
},
"type": "object"
},
"MCASCheckRequirements": {
"allOf": [
{
"$ref": "#/definitions/DataConnectorsCheckRequirements"
},
{
"$ref": "#/definitions/DataConnectorTenantId"
}
],
"description": "MCAS (Microsoft Cloud App Security) requirements check properties.",
"type": "object",
"discriminator": "kind",
"required": [
"kind"
]
},
"MDATPDataConnector": {
"allOf": [
{
Expand Down Expand Up @@ -4882,6 +5109,22 @@
"description": "MDATP (Microsoft Defender Advanced Threat Protection) data connector properties.",
"type": "object"
},
"MDATPCheckRequirements": {
"allOf": [
{
"$ref": "#/definitions/DataConnectorsCheckRequirements"
},
{
"$ref": "#/definitions/DataConnectorTenantId"
}
],
"description": "MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties.",
"type": "object",
"discriminator": "kind",
"required": [
"kind"
]
},
"MalwareEntity": {
"allOf": [
{
Expand Down Expand Up @@ -6080,7 +6323,10 @@
],
"description": "The Setting.",
"discriminator": "kind",
"type": "object"
"type": "object",
"required": [
"kind"
]
},
"SettingsKind": {
"description": "Describes an Azure resource with kind.",
Expand Down Expand Up @@ -6147,6 +6393,22 @@
},
"type": "object"
},
"TICheckRequirements": {
"allOf": [
{
"$ref": "#/definitions/DataConnectorsCheckRequirements"
},
{
"$ref": "#/definitions/DataConnectorTenantId"
}
],
"description": "TI (Threat Intelligence) requirements check properties.",
"type": "object",
"discriminator": "kind",
"required": [
"kind"
]
},
"ThreatIntelligence": {
"description": "ThreatIntelligence property bag.",
"properties": {
Expand Down Expand Up @@ -6537,6 +6799,16 @@
"type": "string",
"x-ms-parameter-location": "method"
},
"DataConnectorsCheckRequirementsBody": {
"description": "The parameters for requirements check message",
"in": "body",
"name": "DataConnectorsCheckRequirements",
"required": true,
"schema": {
"$ref": "#/definitions/DataConnectorsCheckRequirements"
},
"x-ms-parameter-location": "method"
},
"EntityExpandRequestBody": {
"description": "The parameters required to execute an expand operation on the given entity.",
"in": "body",
Expand Down
Loading