Skip to content

Commit

Permalink
[Storage] Remove secure SMB feature (#14262)
Browse files Browse the repository at this point in the history
  • Loading branch information
blueww authored Feb 22, 2021
1 parent 63c3b4d commit 7c4918b
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 1,658 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,5 @@ public void TestShareSoftDeletee()
{
TestController.NewInstance.RunPsTest(_logger, "Test-ShareSoftDelete");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestFileServiceProperties()
{
TestController.NewInstance.RunPsTest(_logger, "Test-FileServiceProperties");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -253,75 +253,4 @@ function Test-ShareSoftDelete
}
}

<#
.SYNOPSIS
Test Storage File Service Properties
.DESCRIPTION
SmokeTest
#>
function Test-FileServiceProperties
{
# Setup
$rgname = Get-StorageManagementTestResourceName;

try
{
# Test
$stoname = 'sto' + $rgname;
$stotype = 'Premium_LRS';
$loc = Get-ProviderLocation_Canary2 ResourceManagement;
$kind = 'FileStorage'

Write-Verbose "RGName: $rgname | Loc: $loc"
New-AzResourceGroup -Name $rgname -Location $loc;

# $loc = Get-ProviderLocation_Canary ResourceManagement;
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind
$stos = Get-AzStorageAccount -ResourceGroupName $rgname;

# Enable MC, and set smb setting
Update-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname `
-SMBProtocolVersion SMB2.1,SMB3.0,SMB3.1.1 `
-SMBAuthenticationMethod Kerberos,NTLMv2 `
-SMBKerberosTicketEncryption RC4-HMAC,AES-256 `
-SMBChannelEncryption AES-128-CCM,AES-128-GCM,AES-256-GCM
$servicePropertie = Get-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname
Assert-AreEqual 3 $servicePropertie.ProtocolSettings.Smb.Versions.Count
Assert-AreEqual 2 $servicePropertie.ProtocolSettings.Smb.AuthenticationMethods.Count
Assert-AreEqual 2 $servicePropertie.ProtocolSettings.Smb.KerberosTicketEncryption.Count
Assert-AreEqual 3 $servicePropertie.ProtocolSettings.Smb.ChannelEncryption.Count

# Disable MC, update smb setting
Update-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname `
-SMBProtocolVersion SMB3.1.1 `
-SMBAuthenticationMethod Kerberos `
-SMBKerberosTicketEncryption AES-256 `
-SMBChannelEncryption AES-128-CCM
$servicePropertie = Get-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname
Assert-AreEqual "SMB3.1.1" $servicePropertie.ProtocolSettings.Smb.Versions[0]
Assert-AreEqual "Kerberos" $servicePropertie.ProtocolSettings.Smb.AuthenticationMethods[0]
Assert-AreEqual "AES-256" $servicePropertie.ProtocolSettings.Smb.KerberosTicketEncryption[0]
Assert-AreEqual "AES-128-CCM" $servicePropertie.ProtocolSettings.Smb.ChannelEncryption[0]

# remove smb setting
Update-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname `
-SMBProtocolVersion @() `
-SMBAuthenticationMethod @()`
-SMBKerberosTicketEncryption @() `
-SMBChannelEncryption @()
$servicePropertie = Get-AzStorageFileServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname
Assert-AreEqual $null $servicePropertie.ProtocolSettings.Smb.Versions
Assert-AreEqual $null $servicePropertie.ProtocolSettings.Smb.AuthenticationMethods
Assert-AreEqual $null $servicePropertie.ProtocolSettings.Smb.KerberosTicketEncryption
Assert-AreEqual $null $servicePropertie.ProtocolSettings.Smb.ChannelEncryption

Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname;
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}


Loading

0 comments on commit 7c4918b

Please sign in to comment.