hashicorp / hashicorp/packer-plugin-azure

Create a technical document giving detailed steps on how to configure Packer to use private Azure vNet with public IP

Open
#503 2 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Go
Stars
63
Forks
103
PR merge metrics
No merged PRs in 30d

Description

#### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

#### Description

Create a technical document giving detailed steps on how to configure Packer to use private Azure vNet with public IP. Such a guide would have saved me many hours trying to address this problem:
Without other changes, Packer in Azure creates a vNet, NSG, and public IP address resources. The NSG is to open access to WinRM, but is otherwise default out-of-box rules. The Packer NSG does not block SMB outbound ports 445 and 137-139, which my security organization has determined is a risk, even though the resources might be short lived. What if for example, the build fails and fails to clean up the resources? We have a running VM that has ports exposed to the Internet. We need to block those and such an article like this proposal would be a big help.

#### Use Case(s)

Where we can pre-create an Azure vNet, then create an associated Azure Network Security group (NSG). We can then edit that NSG and an an SMB outbound deny rule for ports 445, and 137-139. Now Packer can use that, it can create its public IP, and everyone is happy.

#### Code examples

#### Potential configuration

```
variable "virtual_network_name" {
type = string
default = "Packer_TempBuild_vNet"
}

variable "virtual_network_subnet_name" {
type = string
default = "default"
}

variable "virtual_network_resource_group_name" {
type = string
default = "packer-temp-build"
}

virtual_network_name = var.virtual_network_name
virtual_network_resource_group_name = var.virtual_network_resource_group_name
virtual_network_subnet_name = var.virtual_network_subnet_name
private_virtual_network_with_public_ip = true
```

#### Potential References

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the Packer Azure plugin configuration for virtual_network_name, virtual_network_subnet_name, virtual_network_resource_group_name, and private_virtual_network_with_public_ip. Document the steps for using a pre-created Azure vNet and NSG, including the SMB outbound deny rules for ports 445 and 137-139. Done means the guide provides a complete, reproducible configuration example and explains the expected public IP behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, documentation, networking
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.