Skip to content

Add ThreatIntelWhitelist to AzFirewall commands #10390

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

Merged
merged 17 commits into from
Oct 29, 2019
Merged

Add ThreatIntelWhitelist to AzFirewall commands #10390

merged 17 commits into from
Oct 29, 2019

Conversation

b564518128
Copy link
Contributor

@b564518128 b564518128 commented Oct 25, 2019

Description

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
    • the markdown help files have been regenerated using the commands listed here

@adxsdkps
Copy link
Collaborator

Can one of the admins verify this patch?

@b564518128 b564518128 changed the title Merge network Add ThreatIntelWhitelist to AzFirewall commands Oct 25, 2019
@anton-evseev
Copy link
Contributor

Depends on #10386

@wyunchi-ms wyunchi-ms self-assigned this Oct 25, 2019
@wyunchi-ms
Copy link
Contributor

Hi @b564518128 @number213 could you please take a look at this PR? Because there are too many changed files even after I merged the network-october. I don't think this make sense.

Copy link
Contributor

@anton-evseev anton-evseev left a comment

Choose a reason for hiding this comment

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

Please also consider renaming TestAzureFirewallAdditionalPropertyCRUD. It made sense in Andrey's PR, but with ThreatIntel cmdlet it's confusing

@b564518128
Copy link
Contributor Author

Please also consider renaming TestAzureFirewallAdditionalPropertyCRUD. It made sense in Andrey's PR, but with ThreatIntel cmdlet it's confusing

Changed the test name

anton-evseev
anton-evseev previously approved these changes Oct 25, 2019
anton-evseev
anton-evseev previously approved these changes Oct 25, 2019
@b564518128
Copy link
Contributor Author

hi @wyunchi-ms , I updated the PR and removed the unnecessary helper md. Please complete the PR

anton-evseev
anton-evseev previously approved these changes Oct 25, 2019
@isra-fel
Copy link
Member

Azure/azure-powershell-cmdlet-review-pr/issues/410


namespace Microsoft.Azure.Commands.Network
{
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FirewallThreatIntelWhitelist", SupportsShouldProcess = true), OutputType(typeof(PSAzureFirewallThreatIntelWhitelist))]
Copy link
Member

Choose a reason for hiding this comment

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

No need for shouldprocess cause this cmdlet is creating an in-memory object, not modifying anything on Azure

Suggested change
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FirewallThreatIntelWhitelist", SupportsShouldProcess = true), OutputType(typeof(PSAzureFirewallThreatIntelWhitelist))]
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FirewallThreatIntelWhitelist"), OutputType(typeof(PSAzureFirewallThreatIntelWhitelist))]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@isra-fel After I removed this, the check is emitting this error:
"New-AzFirewallThreatIntelWhitelist Does not support ShouldProcess but the cmdlet verb New indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
Could you please take a loo?


# Verify
$getAzureFirewall = Get-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname
Assert-AreEqual true (-not (Compare-Object $threatIntelWhitelist1.FQDNs $getAzureFirewall.ThreatIntelWhitelist.FQDNs))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Assert-AreEqual true (-not (Compare-Object $threatIntelWhitelist1.FQDNs $getAzureFirewall.ThreatIntelWhitelist.FQDNs))
Assert-AreEqualArray $threatIntelWhitelist1.FQDNs $getAzureFirewall.ThreatIntelWhitelist.FQDNs

Same suggestion for the below assertions

Copy link
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
Member

Choose a reason for hiding this comment

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

This is not changed

@isra-fel
Copy link
Member

isra-fel commented Oct 29, 2019

Unresolved one conversation.
And for the static analysis failure, please refer here to suppress it:
https://github.com/Azure/azure-powershell/blob/master/documentation/Debugging-StaticAnalysis-Errors.md#signature-issues

@isra-fel isra-fel merged commit c16eaa2 into Azure:master Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants