Azure / Azure/azure-cli

`az vm/vmss create`: `--nsg-rule` should default to `NONE`

Open
#20,896 2 comments 1 reaction 1 assignee Assigned to @zhoxing-ms View on GitHub
act-observability-squad Compute feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## Context

`--nsg-rule` from `az vm create` by default opens port `3389` for RDP on Windows VM and port `22` for SSH on Linux VM to **public internet**:

```
> az vm create --help
...
--nsg-rule : NSG rule to create when creating
a new NSG. Defaults to open
ports for allowing RDP on
Windows and allowing SSH on
Linux. NONE represents no NSG
rule. Allowed values: NONE,
RDP, SSH.
```

This imposes a security risk and will trigger sev 2 IcM. If this behavior is considered insecure Microsoft/Azure internally, it is considered insecure externally for public users.

## Proposed solution

`--nsg-rule` should be default to `NONE`. User must explicitly specify `RDP` or `SSH`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.