Skip to content

Brooklyn Feature: Point To Site IPSec custom policy set on Gateway #5909

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 36 commits into from
May 23, 2018

Conversation

Nilambari
Copy link
Member

@Nilambari Nilambari commented Apr 9, 2018

Description

Checklist

@MiYanni MiYanni changed the title Brooklyn Fetaure:- Point To Site IPSec custom policy set on Gateway. Brooklyn Feature: Point To Site IPSec custom policy set on Gateway Apr 20, 2018
@MiYanni
Copy link
Contributor

MiYanni commented Apr 20, 2018

@cormacpayne
Copy link
Member

@Nilambari please take a look at the build failures in the markdown help files:

Target Description
New-AzureRmVirtualNetworkGateway.md Trailing yaml string found in description for parameter VpnClientIpsecPolicy. Please move the trailing yaml string to a line by itself.
Set-AzureRmVirtualNetworkGateway.md Trailing yaml string found in description for parameter VpnClientIpsecPolicy. Please move the trailing yaml string to a line by itself.

@cormacpayne cormacpayne removed their assignment May 7, 2018
@@ -31,36 +31,31 @@ public void TestZoneCrud()
DnsTestsBase.NewInstance.RunPowerShellTest("Test-ZoneCrud");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Fact(Skip = "Test is failing, service team needs to re-record")]
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari why are these tests failing? @muwaqar would you mind working with Nilambari to enable these tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Enabled skipped tests back as tests are passing now.

@@ -34,6 +34,16 @@
* Add support for DDoS protection plan resource
* Introduced multiple breaking changes
- Please refer to the migration guide for more information
* Updated below commands for feature: Point to Site IPsec custom policy set/remove on Brooklyn Gateway.
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari please move the snippet you are adding to below the ## Current Release header

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

{
base.Execute();

if (ShouldProcess("AzureRmVpnClientIpsecParameter", VerbsCommon.Get))
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari please remove the call to ShouldProcess for this cmdlet

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

{
base.Execute();

if (ShouldProcess(Properties.Resources.CreatingResourceMessage + Properties.Resources.VirtualNetworkGatewayVpnClientIpsecPolicy))
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari it doesn't appear that this cmdlet doesn't make any calls to the server, it's just creating an in-memory object. If that is the case, then you don't need ShouldProcess and you can remove SupportsShouldProcess from the cmdlet attribute

Copy link
Member Author

Choose a reason for hiding this comment

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

That's right. Done.

MNM.IpsecEncryption.GCMAES128,
MNM.IpsecEncryption.AES256,
MNM.IpsecEncryption.AES128,
IgnoreCase = false)]
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari is there any reason we need to be case sensitive for all of these parameters using ValidateSet? I think we should make all ValidateSet attributes case insensitive, so removing the IgnoreCase = False line from each one will resolve this issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.


### Create new virtual network gateway with setting vpn custom ipsec policy:
```
PS C:\> New-AzureRmVirtualNetworkGateway -ResourceGroupName vnet-gateway -name myNGW -location $location -IpConfigurations $vnetIpConfig -GatewayType Vpn -VpnType RouteBased -GatewaySku VpnGw1 -VpnClientIpsecPolicy $vpnclientipsecpolicy
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari same comment about adding corresponding output

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.


### Get virtual network gateway to see if vpn custom policy is set correctly:
```
$gateway = Get-AzureRmVirtualNetworkGateway -ResourceGroupName vnet-gateway -name myNGW
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari nit: please add the PS C:\> string before this command to be consistent with the line below it

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

# Remove-AzureRmVpnClientIpsecParameter

## SYNOPSIS
{{Fill in the Synopsis}}
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari please fill in a synopsis

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.


### 1: Deletes the set vpn ipsec parameters set on the Virtual Network Gateway
```
Remove-AzureRmVpnClientIpsecParameter -VirtualNetworkGatewayName myGateway -ResourceGroupName myRG
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari same comment about adding the corresponding output

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

### Example 1 : Sets a custom vpn ipsec policy to existing virtual network gateway.
```powershell
PS C:\>$vpnclientipsecparams = New-AzureRmVpnClientIpsecParameter -IpsecEncryption AES256 -IpsecIntegrity SHA256 -SALifeTime 86473 -SADataSize 429498 -IkeEncryption AES256 -IkeIntegrity SHA384 -DhGroup DHGroup2 -PfsGroup PFS2
PS C:\> $setvpnIpsecParams = Set-AzureRmVpnClientIpsecParameter -VirtualNetworkGatewayName "ContosoLocalGateway" -ResourceGroupName "ContosoResourceGroup" -VpnClientIPsecParameter $vpnclientipsecparams
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari same comment about adding corresponding output

Copy link
Member Author

@Nilambari Nilambari May 15, 2018

Choose a reason for hiding this comment

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

Done. Added output details in comment.

@Nilambari
Copy link
Member Author

@cormacpayne Incorporated requested review comments. Please take a look and help accept the PR. Thanks!

@Nilambari
Copy link
Member Author

@cormacpayne I think build failed due to static analysis errors. It asks for adding ShouldProcess to commandlets:- New-AzureRmVpnClientIpsecPolicy & New-AzureRmVpnClientIpsecParameter which was removed as per latest code review comments. Can you Please advice what to do in this case in order for build to pass?

@Nilambari
Copy link
Member Author

@cormacpayne Build is passed, Can you help accept the PR? Thanks!

@cormacpayne cormacpayne changed the base branch from preview to release-6.1.0 May 17, 2018 00:20
@cormacpayne
Copy link
Member

@cormacpayne
Copy link
Member

@cormacpayne cormacpayne changed the base branch from release-6.1.0 to preview May 18, 2018 21:09
@maddieclayton
Copy link
Contributor

@cormacpayne
Copy link
Member

@Nilambari
Copy link
Member Author

@cormacpayne Seems on demand job is successful, can you Please help merge this PR?

@@ -22,6 +22,16 @@

## Version 6.1.0
* Bump up Network SDK version from 18.0.0-preview to 19.0.0-preview
* Updated below commands for feature: Point to Site IPsec custom policy set/remove on Brooklyn Gateway.
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari we'll need to move the release notes you added to be under the Current Release header above, but we can do that in a separate PR

@cormacpayne cormacpayne merged commit ba6ba51 into Azure:preview May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants