This commit is contained in:
Chris Givens 2020-06-23 17:41:03 -07:00
Родитель 463911b513
Коммит aee4d4cfa3
2 изменённых файлов: 9 добавлений и 31 удалений

Просмотреть файл

@ -1,23 +1,2 @@
Configuration SetFirewallRule
{
param ($MachineName)
Import-DSCResource -ModuleName xNetworking
Node $MachineName
{
xFirewall Firewall1433
{
Name = 'SQLFirewallRule'
DisplayName = 'Firewall Rule for SQL Server'
Group = 'SQL Firewall Rule Group'
Ensure = 'Present'
Enabled = 'True'
Profile = ('Domain', 'Private')
Direction = 'Inbound'
LocalPort = ('1433')
Protocol = 'TCP'
Description = 'Firewall Rule for SQL Server'
}
}
}
#run a firewall rule
$(netsh firewall add portopening TCP 1433 "Open Port 1433")

Просмотреть файл

@ -909,16 +909,15 @@
"[concat('Microsoft.Compute/virtualMachines/', 'db-1')]"
],
"properties": {
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.19",
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.7",
"autoUpgradeMinorVersion": true,
"settings": {
"ModulesUrl": "https://github.com/Microsoft/MCW-Azure-security-privacy-and-compliance/blob/master/Hands-on%20lab/Scripts/Set_FirewallRule.zip?raw=true",
"ConfigurationFunction": "Set_FirewallRule.ps1\\SetFirewallRule",
"Properties": {
"MachineName": "db-1"
}
"fileUris" : [
"https://raw.githubusercontent.com/givenscj/MCW-Security-baseline-on-Azure/master/Hands-on%20lab/Scripts/Set_FirewallRule/Set_FirewallRule.ps1"
],
"commandToExecute" : "powershell.exe -ExecutionPolicy bypass -File Set_FirewallRule.ps1"
},
"protectedSettings": null
}