Skip to content

Add topology Rest API#3426

Merged
lmazuel merged 2 commits intoAzure:masterfrom
yanivn3:master
Oct 15, 2018
Merged

Add topology Rest API#3426
lmazuel merged 2 commits intoAzure:masterfrom
yanivn3:master

Conversation

@yanivn3
Copy link
Copy Markdown
Contributor

@yanivn3 yanivn3 commented Jul 17, 2018

Adding topology Rest API for Azure Security Center.
TFS item: https://msazure.visualstudio.com/One/_workitems/edit/2555019

@AutorestCI
Copy link
Copy Markdown

AutorestCI commented Jul 17, 2018

Automation for azure-sdk-for-python

Nothing to generate for azure-sdk-for-python

@yanivn3 yanivn3 changed the title Add topology Rest API Add topology Rest API [DoNotMerge] Jul 17, 2018
@AutorestCI
Copy link
Copy Markdown

AutorestCI commented Jul 17, 2018

Automation for azure-sdk-for-go

A PR has been created for you based on this PR content.

Once this PR will be merged, content will be added to your service PR:
Azure/azure-sdk-for-go#3017

@AutorestCI
Copy link
Copy Markdown

AutorestCI commented Jul 17, 2018

Automation for azure-sdk-for-ruby

Nothing to generate for azure-sdk-for-ruby

@AutorestCI
Copy link
Copy Markdown

AutorestCI commented Jul 17, 2018

Automation for azure-sdk-for-node

Nothing to generate for azure-sdk-for-node

@AutorestCI
Copy link
Copy Markdown

AutorestCI commented Jul 17, 2018

Automation for azure-sdk-for-java

Nothing to generate for azure-sdk-for-java

@chlahav chlahav self-requested a review July 17, 2018 15:26
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Security/topology": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

missing example

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for all the operations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

examples added

"type": "string",
"description": "The UTC time on which topology where calculated"
},
"Resources": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change to camel case

"TopologyResourceProperties": {
"type": "object",
"properties": {
"calculatedDateTime": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"format": "date-time",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also add "readOnly": true

"properties": {
"calculatedDateTime": {
"type": "string",
"description": "The UTC time on which topology where calculated"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"The UTC time on which the topology was calculated

},
"Resources": {
"type": "array",
"description": "Azure resources which re part of this topology resource",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Azure resources which are part of this topology

"TopologyResourceName": {
"name": "topologyResourceName",
"in": "path",
"description": "Name of an topology resource group.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

resource group?
isn't it just a resource?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No. Each topology contains list of Azure resource. For example: topology/vms contains all vms belongs to this topology

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the term "resource group" is already in use so it might confuse customers, please change the description

"/subscriptions/{subscriptionId}/providers/Microsoft.Security/topology": {
"get": {
"tags": ["Topology"],
"description": "Gets a list that allows to build a toplogy view of subscription.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gets a list that allows to build a topology view of a subscription.

"/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topology": {
"get": {
"tags": ["Topology"],
"description": "Gets a list that allows to build a toplogy view of subscription and location.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gets a list that allows to build a topology view of a subscription and location.

"get": {
"tags": ["Topology"],
"description": "Gets a list that allows to build a toplogy view of subscription and location.",
"operationId": "Toplogy_ListByHomeRegion",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Topology_ListByHomeRegion

"get": {
"tags": ["Topology"],
"description": "Gets a list that allows to build a toplogy view of subscription.",
"operationId": "Toplogy_List",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Topology_List

@lmazuel lmazuel added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jul 18, 2018
@lmazuel lmazuel requested a review from ravbhatnagar July 18, 2018 19:04
@chlahav chlahav added the DoNotMerge <valid label in PR review process> use to hold merge after approval label Jul 19, 2018
@yanivn3 yanivn3 changed the title Add topology Rest API [DoNotMerge] Add topology Rest API Jul 19, 2018
@@ -1254,9 +1254,14 @@
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Security/topology": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

type names should be plural (topologies)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a different case, since we return single topology.

"resources": [
{
"resourceId": {
"ID": "/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

field names should be camel case (id)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. Example was old version. resourceId is a string, not an object.

"location": "westus",
"children": [
{
"resourceId": "/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

resource Id should be an object containing the "id" property you also have a test that failed on that

"type": "boolean",
"description": "Indicates if the resource has direct connectivity to the Internet"
},
"secureScore": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

talked to PMs,
this field name should be changed

"TopologyResourceName": {
"name": "topologyResourceName",
"in": "path",
"description": "Name of an topology resource group.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the term "resource group" is already in use so it might confuse customers, please change the description

@chlahav
Copy link
Copy Markdown
Contributor

chlahav commented Jul 19, 2018

please make the "MODE=model PR_ONLY=true" test pass

Copy link
Copy Markdown
Contributor

@chlahav chlahav left a comment

Choose a reason for hiding this comment

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

Please address these minor changes

]
},
"TopologyList": {
"type": "object",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add description

}
},
"TopologyResource": {
"type": "object",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add description

},
"TopologyResourceProperties": {
"type": "object",
"properties": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add description

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for all the objects below as well, it will make the documentation look better

"topologyScore": {
"type": "integer",
"readOnly": true,
"description": "Security score of the resource based on its severity, siblings security status and location in topology (to be used for clustering similar objects together)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you change the term security score in the description as well?
I think that "Score of the resource based on its security severity" is good enough

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed

Copy link
Copy Markdown
Contributor

@ravbhatnagar ravbhatnagar left a comment

Choose a reason for hiding this comment

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

Looks fine. Just few comments. Can be merged based on the reply to my comments.

"readOnly": true,
"description": "The UTC time on which the topology was calculated"
},
"resources": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please rename this property to something else. It can potentially conflict with the Deep PUT common model that ARM team is working on enabling

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed to topologyResources

"readOnly": true,
"description": "Indicates if the resource has security recommendations"
},
"internetFacing": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

bools are generally not recommended, they are less descriptive and have removes any scope of future expansion in case you need more states to be reflected through that property.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree. In the UI we actually show this as "Network Zones", changed to networkZones here as well (InternetFacing is one of the options).

"readOnly": true,
"description": "Indicates if the resource has direct connectivity to the Internet"
},
"topologyScore": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How does a customer interpret an integer value for the topologyScore? Is 5 good or does it indicate a problem? what is the range of supported values. String enum better for this? If you need integer, may be add description. can it be an enum?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The goal of the score is for clustering and filtering in UI. Since we have customers with many resources, by default we show resources with higher score (lower score items will be less visible). also, resources with same score may be clustered into same UI object.
This is private preview concept and we may improve the explanation upon feedback from customers (before going public)

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Jul 31, 2018
@ravbhatnagar
Copy link
Copy Markdown
Contributor

Looks good

@azuresdkci
Copy link
Copy Markdown
Contributor

Can one of the admins verify this patch?

@lmazuel
Copy link
Copy Markdown
Member

lmazuel commented Sep 14, 2018

@chlahav I'm waiting for the fix on the minor changes you asked. Let me know if there is anything I can do.
Thank you

@AutorestCI
Copy link
Copy Markdown

AutorestCI commented Oct 9, 2018

Automation for azure-sdk-for-js

Nothing to generate for azure-sdk-for-js

@chlahav chlahav removed the DoNotMerge <valid label in PR review process> use to hold merge after approval label Oct 9, 2018
@lmazuel
Copy link
Copy Markdown
Member

lmazuel commented Oct 9, 2018

Please look at the model job for remaining errors:
https://travis-ci.org/Azure/azure-rest-api-specs/jobs/439100392

Thanks,

@DanaPeled
Copy link
Copy Markdown

Hi
We fixed the remaining errors
@lmazuel
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants