Skip to content

Introducing new API for Advanced Threat Protection#3306

Merged
marstr merged 8 commits intoAzure:masterfrom
tomerlmsft:master
Sep 17, 2018
Merged

Introducing new API for Advanced Threat Protection#3306
marstr merged 8 commits intoAzure:masterfrom
tomerlmsft:master

Conversation

@tomerlmsft
Copy link
Contributor

@tomerlmsft tomerlmsft commented Jun 26, 2018

API form -
{resourceUri}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}

Suppporting verbs -
GET, PUT and Delete.

URI example -
/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current

Design doc for ATP -
https://microsoft.sharepoint.com/teams/Data_Security/Documents/Dev%20Specs/Storage%20Threat%20Detection/Threat%20Detection%20for%20Azure%20Storage%20-%20Design%20Document.docx?d=w996c55b5a160468c9a9bd0434418a4d0

VSTS item -
#247253, #257790

This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.

PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

API form -
{resourceUri}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}

Suppporting verbs -
GET, PUT and Delete.

URI example -
/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current

Design doc for ATP -
https://microsoft.sharepoint.com/teams/Data_Security/Documents/Dev%20Specs/Storage%20Threat%20Detection/Threat%20Detection%20for%20Azure%20Storage%20-%20Design%20Document.docx?d=w996c55b5a160468c9a9bd0434418a4d0
@AutorestCI
Copy link

AutorestCI commented Jun 26, 2018

Automation for azure-sdk-for-python

Nothing to generate for azure-sdk-for-python

@AutorestCI
Copy link

AutorestCI commented Jun 26, 2018

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#2710

@AutorestCI
Copy link

AutorestCI commented Jun 26, 2018

Automation for azure-sdk-for-node

Nothing to generate for azure-sdk-for-node

@AutorestCI
Copy link

AutorestCI commented Jun 26, 2018

Automation for azure-sdk-for-ruby

Nothing to generate for azure-sdk-for-ruby

@AutorestCI
Copy link

AutorestCI commented Jun 26, 2018

Automation for azure-sdk-for-java

Nothing to generate for azure-sdk-for-java

"200": {
"description": "Successful request to get Advanced Threat Protection settings.",
"schema": {
"$ref": "#/definitions/AdvancedThreatProtectionSettings"
Copy link
Contributor

Choose a reason for hiding this comment

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

"AdvancedThreatProtectionSetting" (singular)

Copy link
Contributor

Choose a reason for hiding this comment

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

I would also rename this to "AdvancedThreatProtection" so it will make more sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resource type is always plural across all azure -
diagnosticSettings, servers, databases, geoBackupPolicies, operationResults, extendedDiagnosticSettings, etc...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's plural also in ASC - securityContacts, workspaceSettings, pricings, etc...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding AdvancedThreatProtection vs AdvancedThreatProtectionSettings -
We reviewed it internally and I changed to AdvancedThreatProtectionSettings following a feedback I got.
The purpose of these type is indeed settings so it make sense to me more than AdvancedThreatProtection which doesn't really imply on the real intent.
Also here, all previous features we released followed this pattern -
VulnerabilityAssessmentSettings, auditingSettings.
and in ASC - workspaceSettings, autoProvisioningSettings, etc...

Copy link
Contributor

@chlahav chlahav Jul 2, 2018

Choose a reason for hiding this comment

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

I talked about the object name and not the resource type
the object that you return is only one setting and not settings

in workspaceSettings etc. it's the same

},
"tags": [ "AdvancedThreatProtection" ],
"description": "Creates or updates the Advanced Threat Protection settings on a specified resource.",
"operationId": "AdvancedThreatProtection_Put",
Copy link
Contributor

Choose a reason for hiding this comment

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

AdvancedThreatProtection_Create

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

}
}
},
"delete": {
Copy link
Contributor

Choose a reason for hiding this comment

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

delete doesn't have a lot of meaning here
what's the difference between this and "isEnabled": false?

please pick one of them (is enabled property or create delete a resource)
I suggest the property since it will allow you to use policies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sense, I removed the DELETE operation

"settingName": "current"
},
"responses": {
"200": {
Copy link
Contributor

Choose a reason for hiding this comment

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

missing 204 example (copy from the JIT delete)

you also have a test that fails on that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm removing the DELETE operation and stays only with GET and PUT.
When no settings are exists, GET will return "isEnalbed : false" value.
Using PUT, we'll be able to turn the settings ON or OFF.

},
"AdvancedThreatProtectionProperties": {
"properties": {
"isEnabled": {
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to "enabled"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

"description": "name of the Compliance",
"x-ms-parameter-location": "method"
},
"ResourceUri": {
Copy link
Contributor

Choose a reason for hiding this comment

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

change to "resourceId" to use the same standard as other RPs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks

@chlahav
Copy link
Contributor

chlahav commented Jun 27, 2018

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

@chlahav chlahav self-requested a review June 27, 2018 08:29
@marstr
Copy link
Member

marstr commented Jun 27, 2018

To @chlahav's point, there are some missing and inconsistent examples. You can find details caught by our linter here: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/396930169#L748

"200": {
"description": "Successful request to remove Advanced Threat Protection setting."
},
"204": {
Copy link
Member

Choose a reason for hiding this comment

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

Just out of curiosity, is there any scenario where this operation would return a 404?

For example:
200 -> Deleted a resource, it's former contents are returned in this response
204 -> This resource was just deleted by another request.
404 -> There was never a resource by this name.

I'm just not sure what the right REST idiom is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the DELETE operation and stayed only with PUT (following Chen feedback, see above)

@marstr marstr requested review from marstr and ravbhatnagar June 27, 2018 17:19
@marstr marstr added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jun 27, 2018
@tomerlmsft tomerlmsft changed the title Introducing new API for Advanced Threat Protection [Do Not Merge] Introducing new API for Advanced Threat Protection Jun 28, 2018
*Removed DELETE operation, stayed only with GET and PUT.
*Changed ResourceUri to ResourceId
*Changed isEnabled to enabled
@marstr
Copy link
Member

marstr commented Jul 3, 2018

@tomerlmsft, this looks good from my perspective. Given that we've waited for more than a three business days without the ARM team responding, we can go ahead and merge it. However, doing so means you'll potentially have ARM feedback be reported on a production service. This can cause complications. However, it is up to you. Would you like to proceed and have me merge this PR?

"description": "The identifier of the resource.",
"x-ms-parameter-location": "method"
},
"AdvancedThreatProtectionSettingName": {
Copy link
Contributor

Choose a reason for hiding this comment

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

if current is the only value supported for the setting name we should make an enum with one value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also do you support a list API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it to enum with one value, thanks for the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't support LIST in our API, the only available type of settings name right now is "current".

@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 5, 2018
@ravbhatnagar
Copy link
Contributor

Looks good!

@marstr
Copy link
Member

marstr commented Jul 5, 2018

I see you've named this "[Do Not Merge]". When are you expecting this PR to be mergeable, @tomerlmsft?

@tomerlmsft
Copy link
Contributor Author

Hi Mark,
We are still waiting with the merge until the arm manifest will be updated.

@marstr marstr added the DoNotMerge <valid label in PR review process> use to hold merge after approval label Jul 11, 2018
@marstr
Copy link
Member

marstr commented Jul 11, 2018

Added the [DoMergeLabel] to indicate, without opening the PR, that we are waiting for the ARM manifest to be updated.

@marstr
Copy link
Member

marstr commented Jul 25, 2018

I'm going to be on vacation for the next two days (until Monday, July 30th). If this PR needs attention in the mean time, please contact my boss, @salameer.

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@marstr
Copy link
Member

marstr commented Aug 2, 2018

Any updates on this, @tomerlmsft?

@marstr
Copy link
Member

marstr commented Aug 13, 2018

Closing as stale.

@marstr
Copy link
Member

marstr commented Aug 14, 2018

After an offline request by @tomerlmsft, I'm going to reopen this.

@marstr
Copy link
Member

marstr commented Aug 17, 2018

Restarted CI because it looks like the failure on the most recent commit was unrelated to your change.

@tomerlmsft tomerlmsft changed the title [Do Not Merge] Introducing new API for Advanced Threat Protection [Do Not Merge Until September 15th] Introducing new API for Advanced Threat Protection Aug 18, 2018
@marstr
Copy link
Member

marstr commented Aug 24, 2018

Just as a heads up, I'm going to be OOF all next week. However, since this PR is just waiting for the service to be available, I don't think there's any need to reassign while I'm gone. If you need a swagger reviewer to take a look at this, try getting a hold of @salameer or the swagger reviewer email alias.

@marstr
Copy link
Member

marstr commented Sep 10, 2018

@tomerlmsft, heads up on this conflict that has emerged.

@marstr marstr changed the title [Do Not Merge Until September 15th] Introducing new API for Advanced Threat Protection Introducing new API for Advanced Threat Protection Sep 17, 2018
@marstr marstr removed the DoNotMerge <valid label in PR review process> use to hold merge after approval label Sep 17, 2018
@marstr
Copy link
Member

marstr commented Sep 17, 2018

I was asked offline to merge this PR by @tomerlmsft.

@marstr marstr merged commit 1b21e70 into Azure:master Sep 17, 2018
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.

6 participants