Compartilhar via


Criar um HSM de pagamento com host e porta de gerenciamento em diferentes redes virtuais usando o modelo do ARM

HSM de Pagamento do Azure é um serviço "BareMetal" fornecido usando módulos de segurança de hardware de pagamento (HSM) Thales payShield 10K para fornecer operações de chave criptográfica para transações de pagamento críticas em tempo real na nuvem do Azure. O HSM de Pagamento do Azure foi projetado especificamente para ajudar um provedor de serviços e uma instituição financeira individual a acelerar a estratégia de transformação digital de seu sistema de pagamento e adotar a nuvem pública. Para obter mais informações, consulte HSM de Pagamento do Azure: Visão geral.

Este tutorial descreve como criar um HSM de pagamento com host estático e sub-redes de gerenciamento na mesma rede virtual, usando um modelo do ARM. Em vez disso, você pode:

Um modelo do Azure Resource Manager é um arquivo JSON (JavaScript Object Notation) que define a infraestrutura e a configuração do seu projeto. O modelo usa sintaxe declarativa. Você descreve a implantação pretendida sem escrever a sequência de comandos de programação para criar a implantação.

Pré-requisitos

Importante

O HSM de Pagamento do Azure é um serviço especializado. Para se qualificar para integração e uso do HSM de Pagamento do Azure, os clientes devem ter um Gerenciador de Contas da Microsoft atribuído e ter um CSA (Arquiteto de Serviços de Nuvem).

Para saber mais sobre o serviço, inicie o processo de qualificação e prepare os pré-requisitos antes do embarque, peça ao gerente de conta da Microsoft e ao CSA para enviar uma solicitação por email.

  • Você deve registrar os provedores de recursos "Microsoft.HardwareSecurityModules" e "Microsoft.Network", bem como os recursos do HSM de Pagamento do Azure. As etapas para fazer isso estão em Registrar o provedor de recursos do HSM de Pagamento do Azure e as funcionalidades do provedor de recursos.

    Para verificar rapidamente se os provedores de recursos e os recursos já estão registrados, use o comando az provider show da CLI do Azure. (A saída desse comando ficará mais legível se você a exibir em formato de tabela.)

    az provider show --namespace "Microsoft.HardwareSecurityModules" -o table
    
    az provider show --namespace "Microsoft.Network" -o table
    
    az feature registration show -n "FastPathEnabled"  --provider-namespace "Microsoft.Network" -o table
    
    az feature registration show -n "AzureDedicatedHsm"  --provider-namespace "Microsoft.HardwareSecurityModules" -o table
    

    Você pode continuar com este início rápido se todos esses quatro comandos retornarem "Registrado".

  • Você precisa ter uma assinatura do Azure. Você pode criar uma conta gratuita se não tiver uma.

Examinar o modelo

O modelo usado neste início rápido é azuredeploy.json:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "resourceName": {
      "type": "String",
      "metadata": {
        "description": "Azure Payment HSM resource name"
      }
    },
    "host1PrivateIPAddress": {
      "type": "string"
    },
    "host2PrivateIPAddress": {
      "type": "string"
    },
    "stampId": {
      "type": "string",
      "defaultValue": "stamp1",
      "metadata": {
        "description": "stamp id"
      }
    },
    "skuName": {
      "type": "string",
      "defaultValue": "payShield10K_LMK1_CPS60",
      "metadata": {
        "description": "PayShield SKU name. It must be one of the following: payShield10K_LMK1_CPS60, payShield10K_LMK1_CPS250, payShield10K_LMK1_CPS2500, payShield10K_LMK2_CPS60, payShield10K_LMK2_CPS250, payShield10K_LMK2_CPS2500"
      }
    },
    "vnetName": {
      "type": "string",
      "metadata": {
        "description": "Host port virtual network name"
      }
    },
    "vnetAddressPrefix": {
      "type": "string",
      "metadata": {
        "description": "Host port virtual network address prefix"
      }
    },
    "hsmSubnetName": {
      "type": "String",
      "metadata": {
        "description": "Host port subnet name"
      }
    },
    "hsmSubnetPrefix": {
      "type": "string",
      "metadata": {
        "description": "Host port subnet prefix"
      }
    },
    "managementVnetName": {
      "type": "string",
      "metadata": {
        "description": "Management port virtual network name"
      }
    },
    "managementVnetAddressPrefix": {
      "type": "string",
      "metadata": {
        "description": "Management port virtual network address prefix"
      }
    },
    "managementHsmSubnetName": {
      "type": "String",
      "metadata": {
        "description": "Management port subnet name"
      }
    },
    "managementHsmSubnetPrefix": {
      "type": "string",
      "metadata": {
        "description": "Management port subnet prefix"
      }
    }
  },
  "variables": {},
  "resources": [
    {
      "type": "Microsoft.HardwareSecurityModules/dedicatedHSMs",
      "apiVersion": "2021-11-30",
      "name": "[parameters('resourceName')]",
      "location": "[resourceGroup().location]",
      "dependsOn": [
        "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('hsmSubnetName'))]",
        "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('managementVnetName'), parameters('managementHsmSubnetName'))]"
      ],
      "sku": {
        "name": "[parameters('skuName')]"
      },
      "properties": {
        "networkProfile": {
          "subnet": {
              "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('hsmSubnetName'))]"
          },
          "NetworkInterfaces": [
              {
                "privateIpAddress": "[parameters('host1PrivateIPAddress')]"
              },
              {
                "privateIpAddress": "[parameters('host2PrivateIPAddress')]"
              }
          ]
        },  
        "managementNetworkProfile": {
          "subnet": {
            "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('managementVnetName'), parameters('managementHsmSubnetName'))]"
          }
        },
        "stampId": "[parameters('stampId')]"
      }
    },
    {
      "type": "Microsoft.Network/virtualNetworks",
      "apiVersion": "2020-11-01",
      "name": "[parameters('vnetName')]",
      "location": "[resourceGroup().location]",
      "tags": {
        "fastpathenabled": "true"
      },
      "properties": {
        "addressSpace": {
          "addressPrefixes": [
            "[parameters('vnetAddressPrefix')]"
          ]
        },
        "subnets": [
          {
            "name": "[parameters('hsmSubnetName')]",
            "properties": {
              "addressPrefix": "[parameters('hsmSubnetPrefix')]",
              "serviceEndpoints": [],
              "delegations": [
                {
                  "name": "Microsoft.HardwareSecurityModules.dedicatedHSMs",
                  "properties": {
                    "serviceName": "Microsoft.HardwareSecurityModules/dedicatedHSMs"
                  }
                }
              ],
              "privateEndpointNetworkPolicies": "Enabled",
              "privateLinkServiceNetworkPolicies": "Enabled"
            }
          }
        ],
        "virtualNetworkPeerings": [],
        "enableDdosProtection": false
      }
    },
    {
      "type": "Microsoft.Network/virtualNetworks",
      "apiVersion": "2020-11-01",
      "name": "[parameters('managementVnetName')]",
      "location": "[resourceGroup().location]",
      "tags": {
        "fastpathenabled": "true"
      },
      "properties": {
        "addressSpace": {
          "addressPrefixes": [
            "[parameters('managementVnetAddressPrefix')]"
          ]
        },
        "subnets": [
          {
            "name": "[parameters('managementHsmSubnetName')]",
            "properties": {
              "addressPrefix": "[parameters('managementHsmSubnetPrefix')]",
              "serviceEndpoints": [],
              "delegations": [
                {
                  "name": "Microsoft.HardwareSecurityModules.dedicatedHSMs",
                  "properties": {
                    "serviceName": "Microsoft.HardwareSecurityModules/dedicatedHSMs"
                  }
                }
              ],
              "privateEndpointNetworkPolicies": "Enabled",
              "privateLinkServiceNetworkPolicies": "Enabled"
            }
          }
        ],
        "virtualNetworkPeerings": [],
        "enableDdosProtection": false
      }
    },
    {
      "type": "Microsoft.Network/virtualNetworks/subnets",
      "apiVersion": "2020-11-01",
      "name": "[concat(parameters('vnetName'), '/', parameters('hsmSubnetName'))]",
      "dependsOn": [
        "[resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName'))]"
      ],
      "properties": {
        "addressPrefix": "[parameters('hsmSubnetPrefix')]",
        "serviceEndpoints": [],
        "delegations": [
          {
            "name": "Microsoft.HardwareSecurityModules.dedicatedHSMs",
            "properties": {
              "serviceName": "Microsoft.HardwareSecurityModules/dedicatedHSMs"
            }
          }
        ],
        "privateEndpointNetworkPolicies": "Enabled",
        "privateLinkServiceNetworkPolicies": "Enabled"
      }
    },
    {
      "type": "Microsoft.Network/virtualNetworks/subnets",
      "apiVersion": "2020-11-01",
      "name": "[concat(parameters('managementVnetName'), '/', parameters('managementHsmSubnetName'))]",
      "dependsOn": [
        "[resourceId('Microsoft.Network/virtualNetworks', parameters('managementVnetName'))]"
      ],
      "properties": {
        "addressPrefix": "[parameters('managementHsmSubnetPrefix')]",
        "serviceEndpoints": [],
        "delegations": [
          {
            "name": "Microsoft.HardwareSecurityModules.dedicatedHSMs",
            "properties": {
              "serviceName": "Microsoft.HardwareSecurityModules/dedicatedHSMs"
            }
          }
        ],
        "privateEndpointNetworkPolicies": "Enabled",
        "privateLinkServiceNetworkPolicies": "Enabled"
      }
    }
  ]
}

O recurso do Azure definido no modelo é:

  • Microsoft.HardwareSecurityModules.dedicatedHSMs: crie um HSM de pagamento do Azure.

O arquivo de azuredeploy.parameters.json correspondente é:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "resourceName": {
      "value": "myPHSM"
    },
    "stampId": {
      "value": "stamp1"
    },
    "skuName": {
      "value": "payShield10K_LMK1_CPS60"
    },
    "vnetName": {
      "value": "myVNet"
    },
    "vnetAddressPrefix": {
      "value": "10.0.0.0/16"
    },
    "hsmSubnetName": {
      "value": "mySubnet"
    },
    "hsmSubnetPrefix": {
      "value": "10.0.0.0/24"
    },
    "host1PrivateIPAddress": {
      "value": "10.0.0.5"
    },
    "host2PrivateIPAddress": {
      "value": "10.0.0.6"
    },
    "managementVnetName": {
      "value": "MGMTVNet"
    },
    "managementVnetAddressPrefix": {
      "value": "10.1.0.0/16"
    },
    "managementHsmSubnetName": {
      "value": "MGMTSubnet"
    },
    "managementHsmSubnetPrefix": {
      "value": "10.1.0.0/24"
    }
  }
}

Implantar o modelo

Neste exemplo, você usa a CLI do Azure para implantar um modelo do ARM para criar um HSM de pagamento do Azure.

Primeiro, salve os arquivos "azuredeploy.json" e "azuredeploy.parameters.json" localmente, para uso na próxima etapa. O conteúdo desses arquivos pode ser encontrado na seção Examinar o modelo .

Observação

Estas etapas pressupõem que o arquivo "azuredeploy.json" e "azuredeploy.parameters.json" estão no diretório do qual você está executando os comandos. Se os arquivos estiverem em outro diretório, você deverá ajustar os caminhos de arquivo adequadamente.

Em seguida, crie um grupo de recursos do Azure.

Um grupo de recursos é um contêiner lógico no qual os recursos do Azure são implantados e gerenciados. Use o comando az group create para criar um grupo de recursos chamado myResourceGroup na localização eastus.

az group create --name "myResourceGroup" --location "EastUS"

Por fim, use o comando az deployment group create da CLI do Azure para implantar seu modelo do ARM.

az deployment group create --resource-group "MyResourceGroup" --name myPHSMDeployment --template-file "azuredeploy.json"

Quando solicitado, forneça os seguintes valores para os parâmetros:

  • resourceName: myPaymentHSM
  • vnetName: myVNet
  • vnetAddressPrefix: 10.0.0.0/16
  • hsmSubnetName: mySubnet
  • hsmSubnetPrefix: 10.0.0.0/24
  • managementVnetName: MGMTVNet
  • managementVnetAddressPrefix: 10.1.0.0/16
  • managementHsmSubnetName: MGMTSubnet
  • managementHsmSubnetPrefix: 10.1.0.0/24

Próximas etapas

Avance para o próximo artigo para saber como exibir seu HSM de pagamento.

Mais recursos: