Skip to content

Commit

Permalink
Azure templates | Added maintenance mode & serial console password su…
Browse files Browse the repository at this point in the history
…pport

* Azure templates | Added maintenance mode & serial console password support
  • Loading branch information
chkp-yairra authored Aug 27, 2023
1 parent 66b1ac8 commit 8a83d00
Show file tree
Hide file tree
Showing 12 changed files with 714 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,100 @@
"hideConfirmation": false
}
},
{
"name": "SerialPasswordInfoBox",
"type": "Microsoft.Common.InfoBox",
"visible": "[bool(basics('auth').sshPublicKey)]",
"options": {
"icon": "Info",
"text": "Check Point recommends setting serial console password and maintenance-mode password for recovery purposes. For R81.10 and below the serial console password is used also as maintenance-mode password"
}
},
{
"visible": "[bool(basics('auth').sshPublicKey)]",
"name": "EnableSerialConsolePassword",
"type": "Microsoft.Common.OptionsGroup",
"label": "Enable Serial console password",
"defaultValue": "Yes",
"toolTip": "A unique password hash to enable VM connection via serial console.",
"constraints": {
"allowedValues": [
{
"label": "Yes",
"value": true
},
{
"label": "No",
"value": false
}
]
}
},
{
"name": "AdditionalPassword",
"type": "Microsoft.Common.PasswordBox",
"toolTip": "Serial console password hash, used to enable password authentication (using serial console). To generate password hash use the command 'openssl passwd -6 PASSWORD'",
"visible": "[and(bool(basics('auth').sshPublicKey), steps('chkp').EnableSerialConsolePassword)]",
"label": {
"password": "Password hash",
"confirmPassword": "Confirm password"
},
"constraints": {
"required": true,
"regex": "^.{12,300}$",
"validationMessage": "The value must be the output of the hash command."
},
"options": {
"hideConfirmation": false
}
},
{
"name": "MaintenanceModeInfoBox",
"type": "Microsoft.Common.InfoBox",
"visible": "[and(bool(basics('auth').password), not(contains('R80.40 R81 R81.10', steps('chkp').cloudGuardVersion)))]",
"options": {
"icon": "Info",
"text": "Check Point recommends setting a maintenance-mode password for recovery purposes."
}
},
{
"visible": "[not(contains('R80.40 R81 R81.10', steps('chkp').cloudGuardVersion))]",
"name": "EnableMaintenanceMode",
"type": "Microsoft.Common.OptionsGroup",
"label": "Enable Maintenance Mode",
"defaultValue": "Yes",
"toolTip": "A unique password hash to enable VM maintenance mode.",
"constraints": {
"allowedValues": [
{
"label": "Yes",
"value": true
},
{
"label": "No",
"value": false
}
]
}
},
{
"visible": "[and(not(contains('R80.40 R81 R81.10', steps('chkp').cloudGuardVersion)), steps('chkp').EnableMaintenanceMode)]",
"name": "MaintenanceModePassword",
"type": "Microsoft.Common.PasswordBox",
"defaultValue": "",
"toolTip": "To generate a password hash use the command 'grub2-mkpasswd-pbkdf2' on Linux and paste it here.",
"label": {
"password": "Maintenance Mode password hash",
"confirmPassword": "Confirm Password"
},
"constraints": {
"required": true,
"validationMessage": "The value must be the output of the hash command."
},
"options": {
"hideConfirmation": false
}
},
{
"name": "bootstrapScript",
"type": "Microsoft.Common.FileUpload",
Expand Down Expand Up @@ -1307,7 +1401,9 @@
"tagsByResource": "[steps('tags').tagsByResource]",
"deployNewNSG": "[steps('network').NSG]",
"ExistingNSG": "[steps('network').nsgSelector]",
"NewNsgName": "[steps('network').NSGName]"
"NewNsgName": "[steps('network').NSGName]",
"SerialConsolePasswordHash": "[steps('chkp').AdditionalPassword]",
"MaintenanceModePasswordHash": "[steps('chkp').MaintenanceModePassword]"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@
"description": "Email address to notify if there are any scaling operations"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Administrator password"
},
"defaultValue": ""
},
"authenticationType": {
"type": "string",
"allowedValues": [
Expand All @@ -89,6 +82,27 @@
"description": "Administrator SSH public key"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Administrator password"
},
"defaultValue": ""
},
"MaintenanceModePasswordHash": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"Description": "Maintenance mode password hash, relevant only for R81.20 and higher versions"
}
},
"SerialConsolePasswordHash": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"Description": "Optional parameter, used to enable serial console connection in case of SSH key as authentication type"
}
},
"vmName": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -401,7 +415,7 @@
"subnet1Name": "[parameters('subnet1Name')]",
"storageAccountName": "[concat('bootdiag', uniqueString(variables('resourceGroup').id, deployment().name))]",
"storageAccountType": "Standard_LRS",
"customData": "[concat('#!/usr/bin/python3 /etc/cloud_config.py\n', '\n', 'installationType=\"', variables('installationType'), '\"', '\n', 'allowUploadDownload=\"', variables('allowUploadDownload'), '\"', '\n', 'osVersion=\"', variables('osVersion'), '\"', '\n', 'templateName=\"', variables('templateName'), '\"', '\n', 'isBlink=\"', variables('isBlink'), '\"', '\n', 'templateVersion=\"', variables('templateVersion'), '\"', '\n', 'bootstrapScript64=\"', variables('bootstrapScript64'), '\"', '\n', 'location=\"', variables('location'), '\"', '\n', 'sicKey=\"', variables('sicKey'), '\"', '\n', 'customMetrics=\"', variables('customMetrics'), '\"', '\n', 'adminShell=\"', parameters('adminShell'), '\"', '\n')]",
"customData": "[concat('#!/usr/bin/python3 /etc/cloud_config.py\n', '\n', 'installationType=\"', variables('installationType'), '\"', '\n', 'allowUploadDownload=\"', variables('allowUploadDownload'), '\"', '\n', 'osVersion=\"', variables('osVersion'), '\"', '\n', 'templateName=\"', variables('templateName'), '\"', '\n', 'isBlink=\"', variables('isBlink'), '\"', '\n', 'templateVersion=\"', variables('templateVersion'), '\"', '\n', 'bootstrapScript64=\"', variables('bootstrapScript64'), '\"', '\n', 'location=\"', variables('location'), '\"', '\n', 'sicKey=\"', variables('sicKey'), '\"', '\n', 'customMetrics=\"', variables('customMetrics'), '\"', '\n', 'adminShell=\"', parameters('adminShell'), '\"', '\n', 'MaintenanceModePassword=\"', parameters('MaintenanceModePasswordHash'), '\"', '\n', 'passwordHash=\"', parameters('SerialConsolePasswordHash'), '\"', '\n')]",
"imageOffer": "[concat('check-point-cg-', toLower(variables('osVersion')))]",
"imagePublisher": "checkpoint",
"imageReferenceBYOL": {
Expand Down
98 changes: 97 additions & 1 deletion azure/templates/marketplace-ha/createUiDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,100 @@
},
"visible": "true"
},
{
"name": "SerialPasswordInfoBox",
"type": "Microsoft.Common.InfoBox",
"visible": "[bool(basics('auth').sshPublicKey)]",
"options": {
"icon": "Info",
"text": "Check Point recommends setting serial console password and maintenance-mode password for recovery purposes. For R81.10 and below the serial console password is used also as maintenance-mode password"
}
},
{
"visible": "[bool(basics('auth').sshPublicKey)]",
"name": "EnableSerialConsolePassword",
"type": "Microsoft.Common.OptionsGroup",
"label": "Enable Serial console password",
"defaultValue": "Yes",
"toolTip": "A unique password hash to enable VM connection via serial console.",
"constraints": {
"allowedValues": [
{
"label": "Yes",
"value": true
},
{
"label": "No",
"value": false
}
]
}
},
{
"name": "AdditionalPassword",
"type": "Microsoft.Common.PasswordBox",
"toolTip": "Serial console password hash, used to enable password authentication (using serial console). To generate password hash use the command 'openssl passwd -6 PASSWORD'",
"visible": "[and(bool(basics('auth').sshPublicKey), steps('chkp').EnableSerialConsolePassword)]",
"label": {
"password": "Password hash",
"confirmPassword": "Confirm password"
},
"constraints": {
"required": true,
"regex": "^.{12,300}$",
"validationMessage": "The value must be the output of the hash command."
},
"options": {
"hideConfirmation": false
}
},
{
"name": "MaintenanceModeInfoBox",
"type": "Microsoft.Common.InfoBox",
"visible": "[and(bool(basics('auth').password), not(contains('R80.40 R81 R81.10', steps('chkp').cloudGuardVersion)))]",
"options": {
"icon": "Info",
"text": "Check Point recommends setting a maintenance-mode password for recovery purposes."
}
},
{
"visible": "[not(contains('R80.40 R81 R81.10', steps('chkp').cloudGuardVersion))]",
"name": "EnableMaintenanceMode",
"type": "Microsoft.Common.OptionsGroup",
"label": "Enable Maintenance Mode",
"defaultValue": "Yes",
"toolTip": "A unique password hash to enable VM maintenance mode.",
"constraints": {
"allowedValues": [
{
"label": "Yes",
"value": true
},
{
"label": "No",
"value": false
}
]
}
},
{
"visible": "[and(not(contains('R80.40 R81 R81.10', steps('chkp').cloudGuardVersion)), steps('chkp').EnableMaintenanceMode)]",
"name": "MaintenanceModePassword",
"type": "Microsoft.Common.PasswordBox",
"defaultValue": "",
"toolTip": "To generate a password hash use the command 'grub2-mkpasswd-pbkdf2' on Linux and paste it here.",
"label": {
"password": "Maintenance Mode password hash",
"confirmPassword": "Confirm Password"
},
"constraints": {
"required": true,
"validationMessage": "The value must be the output of the hash command."
},
"options": {
"hideConfirmation": false
}
},
{
"name": "managedSystemAssigned",
"type": "Microsoft.Common.OptionsGroup",
Expand Down Expand Up @@ -2056,7 +2150,9 @@
"ExistingNSG": "[steps('network').nsgSelector]",
"NewNsgName": "[steps('network').NSGName]",
"VipsNumber": "[int(steps('network').Vips_Number)]",
"VipNames": "[concat(steps('network').VIP_Names.VIP2_Name, ',', steps('network').VIP_Names.VIP3_Name, ',', steps('network').VIP_Names.VIP4_Name, ',', steps('network').VIP_Names.VIP5_Name, ',', steps('network').VIP_Names.VIP6_Name, ',', steps('network').VIP_Names.VIP7_Name, ',', steps('network').VIP_Names.VIP8_Name, ',', steps('network').VIP_Names.VIP9_Name, ',', steps('network').VIP_Names.VIP10_Name)]"
"VipNames": "[concat(steps('network').VIP_Names.VIP2_Name, ',', steps('network').VIP_Names.VIP3_Name, ',', steps('network').VIP_Names.VIP4_Name, ',', steps('network').VIP_Names.VIP5_Name, ',', steps('network').VIP_Names.VIP6_Name, ',', steps('network').VIP_Names.VIP7_Name, ',', steps('network').VIP_Names.VIP8_Name, ',', steps('network').VIP_Names.VIP9_Name, ',', steps('network').VIP_Names.VIP10_Name)]",
"SerialConsolePasswordHash": "[steps('chkp').AdditionalPassword]",
"MaintenanceModePasswordHash": "[steps('chkp').MaintenanceModePassword]"
}
}
}
30 changes: 22 additions & 8 deletions azure/templates/marketplace-ha/mainTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
"description": "Check Point CloudGuard version"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Administrator password"
},
"defaultValue": ""
},
"authenticationType": {
"type": "string",
"allowedValues": [
Expand All @@ -55,6 +48,27 @@
"description": "Administrator SSH public key"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Administrator password"
},
"defaultValue": ""
},
"MaintenanceModePasswordHash": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"Description": "Maintenance mode password hash, relevant only for R81.20 and higher versions"
}
},
"SerialConsolePasswordHash": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"Description": "Optional parameter, used to enable serial console connection in case of SSH key as authentication type"
}
},
"floatingIP": {
"type": "string",
"allowedValues": [
Expand Down Expand Up @@ -381,7 +395,7 @@
"storageAccountType": "Standard_LRS",
"diskSize100GB": 100,
"diskSizeGB": "[add(parameters('additionalDiskSizeGB'), variables('diskSize100GB'))]",
"customData": "[concat('#!/usr/bin/python3 /etc/cloud_config.py\n', '\n', 'installationType=\"', variables('installationType'), '\"', '\n', 'allowUploadDownload=\"', variables('allowUploadDownload'), '\"', '\n', 'osVersion=\"', variables('osVersion'), '\"', '\n', 'templateName=\"', variables('templateName'), '\"', '\n', 'isBlink=\"', variables('isBlink'), '\"', '\n', 'templateVersion=\"', variables('templateVersion'), '\"', '\n', 'bootstrapScript64=\"', variables('bootstrapScript64'), '\"', '\n', 'location=\"', variables('location'), '\"', '\n', 'sicKey=\"', variables('sicKey'), '\"', '\n', 'location=\"', variables('location'), '\"', '\n', 'tenantId=\"', subscription().tenantId, '\"', '\n', 'virtualNetwork=\"', parameters('virtualNetworkName'), '\"', '\n', 'clusterName=\"', parameters('vmName'), '\"', '\n', 'customMetrics=\"', variables('customMetrics'), '\"', '\n', 'adminShell=\"', parameters('adminShell'), '\"', '\n')]",
"customData": "[concat('#!/usr/bin/python3 /etc/cloud_config.py\n', '\n', 'installationType=\"', variables('installationType'), '\"', '\n', 'allowUploadDownload=\"', variables('allowUploadDownload'), '\"', '\n', 'osVersion=\"', variables('osVersion'), '\"', '\n', 'templateName=\"', variables('templateName'), '\"', '\n', 'isBlink=\"', variables('isBlink'), '\"', '\n', 'templateVersion=\"', variables('templateVersion'), '\"', '\n', 'bootstrapScript64=\"', variables('bootstrapScript64'), '\"', '\n', 'location=\"', variables('location'), '\"', '\n', 'sicKey=\"', variables('sicKey'), '\"', '\n', 'location=\"', variables('location'), '\"', '\n', 'tenantId=\"', subscription().tenantId, '\"', '\n', 'virtualNetwork=\"', parameters('virtualNetworkName'), '\"', '\n', 'clusterName=\"', parameters('vmName'), '\"', '\n', 'customMetrics=\"', variables('customMetrics'), '\"', '\n', 'adminShell=\"', parameters('adminShell'), '\"', '\n', 'MaintenanceModePassword=\"', parameters('MaintenanceModePasswordHash'), '\"', '\n', 'passwordHash=\"', parameters('SerialConsolePasswordHash'), '\"', '\n')]",
"imageOffer": "[concat('check-point-cg-', toLower(variables('osVersion')))]",
"imagePublisher": "checkpoint",
"imageReferenceBYOL": {
Expand Down
Loading

0 comments on commit 8a83d00

Please sign in to comment.