Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/hardware-security-modules/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. :changelog:

Release History
===============

0.1.0
++++++
* Initial release.
.. :changelog:
Release History
===============
0.1.0
++++++
* Initial release.
59 changes: 5 additions & 54 deletions src/hardware-security-modules/README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,5 @@
Microsoft Azure CLI 'hardware-security-modules' Extension
==========================================

### How to use ###
Install this extension using the below CLI command
```
az extension add --name hardware-security-modules
```

### Getting Help

To see examples of commands and parameters details of commands or command groups, one should run the command of interest with a -h

Examples:
```
az dedicated-hsm create -h

az dedicated-hsm list -h

az dedicated-hsm update -h
```


##### Creating a dedicated hardware security module

To create a dedicate hardware security module, one must have already setup all of the following in Azure:

- A VNET
- A subnet for the HSMs in the specified VNET (delegation must be set to HSM)
- A subnet for the virtual network gateway
- A public IP address for the gateway

More instructions can be found at: https://docs.microsoft.com/en-us/azure/dedicated-hsm/

An example of CLI commands that would setup a very basic network that manages a dedicated HSM via a VM would be:

```
az feature register --namespace Microsoft.HardwareSecurityModules --name AzureDedicatedHSM

az feature register --namespace Microsoft.Network --name AllowBaremetalServers

az network vnet create --name vn -g rg1 --subnet-name default

az vm create -g rg1 --name vm1 --image UbuntuLTS

az network vnet subnet create --vnet-name vn -n GatewaySubnet -g rg1 --address-prefix 10.0.5.0/24

az network vnet subnet create --vnet-name vn -g rg1 --name hsm --address-prefixes 10.0.2.0/24 --delegations Microsoft.HardwareSecurityModules/dedicatedHSMs

az network public-ip create -n ERGWVIP -g rg1 --allocation-method Dynamic

az network vnet-gateway create -n ERGW -l japaneast --public-ip-address ERGWVIP -g rg1 --vnet vn --sku standard --gateway-type ExpressRoute

```
Microsoft Azure CLI 'hardware-security-modules' Extension
==========================================

This package is for the 'hardware-security-modules' extension.
i.e. 'az hardware-security-modules'
Original file line number Diff line number Diff line change
@@ -1,47 +1,46 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_hardware_security_modules.generated._help import helps # pylint: disable=unused-import


class AzureDedicatedHSMResourceProviderCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_hardware_security_modules.generated._client_factory import cf_hardwaresecuritymodules
hardwaresecuritymodules_custom = CliCommandType(
operations_tmpl='azext_hardware_security_modules.custom#{}',
client_factory=cf_hardwaresecuritymodules)
super(AzureDedicatedHSMResourceProviderCommandsLoader,
self).__init__(
cli_ctx=cli_ctx, custom_command_type=hardwaresecuritymodules_custom)

def load_command_table(self, args):
from azext_hardware_security_modules.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_hardware_security_modules.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from azext_hardware_security_modules.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_hardware_security_modules.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = AzureDedicatedHSMResourceProviderCommandsLoader
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_hardware_security_modules.generated._help import helps # pylint: disable=unused-import


class AzureDedicatedHSMResourceProviderCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_hardware_security_modules.generated._client_factory import cf_hardware_security_modules
hardware_security_modules_custom = CliCommandType(
operations_tmpl='azext_hardware_security_modules.custom#{}',
client_factory=cf_hardware_security_modules)
parent = super(AzureDedicatedHSMResourceProviderCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=hardware_security_modules_custom)

def load_command_table(self, args):
from azext_hardware_security_modules.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_hardware_security_modules.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from azext_hardware_security_modules.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_hardware_security_modules.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = AzureDedicatedHSMResourceProviderCommandsLoader
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.3.1"
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.3.1"
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_hardwaresecuritymodules(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from ..vendored_sdks.hardwaresecuritymodules import AzureDedicatedHSMResourceProvider
return get_mgmt_service_client(cli_ctx, AzureDedicatedHSMResourceProvider)


def cf_dedicated_hsm(cli_ctx, *_):
return cf_hardwaresecuritymodules(cli_ctx).dedicated_hsm
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
def cf_hardware_security_modules(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from ..vendored_sdks.hardwaresecuritymodules import AzureDedicatedHSMResourceProvider
return get_mgmt_service_client(cli_ctx, AzureDedicatedHSMResourceProvider)
def cf_dedicated_hsm(cli_ctx, *_):
return cf_hardware_security_modules(cli_ctx).dedicated_hsm
Loading