feat(misconf): support for azurerm_network_interface_security_group_association #10215
Open
Dharma-09 wants to merge 2 commits intoaquasecurity:mainfrom
Open
feat(misconf): support for azurerm_network_interface_security_group_association #10215Dharma-09 wants to merge 2 commits intoaquasecurity:mainfrom
Dharma-09 wants to merge 2 commits intoaquasecurity:mainfrom
Conversation
nikpivkin
reviewed
Feb 19, 2026
Comment on lines
+302
to
+306
| { | ||
| name: "with network interface security group association", | ||
| terraform: ` | ||
| resource "azurerm_windows_virtual_machine" "example" { | ||
| name = "example-machine" |
Contributor
There was a problem hiding this comment.
Why add this test for the compute service?
Contributor
Author
There was a problem hiding this comment.
Thanks for your review. Here is my reasoning:
It’s related through the VM adaptation path.
I add compute test because I want to validate the real failing path (VM -> NIC -> NSG association), not just NIC parsing in isolation. We can avoid this test by adding regression test for AZU-0068
- VM adapters (adapt.go (line 145)) read network_interface_ids.
- For each NIC, compute adapter calls network adapter (adapt.go (line 154)) via anetwork.AdaptNetworkInterface.
- Network adapter sets NIC SecurityGroups (adapt.go (line 139)).
- New logic resolves NSG from association resources (adapt.go (line 157)) using:
azurerm_network_interface_security_group_association.network_interface_id
and network_security_group_id on that association (adapt.go (lines 186-188))- plus legacy inline NIC attribute (adapt.go (line 183)).
- So even though the fix is in adapt.go, the failing check is on VMs
nikpivkin
requested changes
Feb 19, 2026
Contributor
nikpivkin
left a comment
There was a problem hiding this comment.
Thanks! I left one comment.
nikpivkin
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
network_security_group_idattribute onazurerm_network_interfacehas been deprecated and removed in newer AzureRM provider versions. The recommended approach is now to associate a Network Security Group (NSG) using the separateazurerm_network_interface_security_group_associationresource.This PR adds support for resolving NSGs attached via the
azurerm_network_interface_security_group_associationresource when adapting network interfaces in the Azure Terraform parser.Related issues
Checklist