Repository navigation
fix(arm): read NSG rules from the securityRules property and child resources - #11663
Merged
Merged
Conversation
4 of 8 tasks
aneviaro
force-pushed
the
fix/arm-nsg-rules
branch
4 times, most recently
from
November 18, 2026 13:31
20386bc to
4efe4ed
Compare
Contributor
Author
|
@nikpivkin could you please review this bugfix as well? 🙏 |
Contributor
|
#11662 is merged, but this branch still has its commits, so the diff has extra changes. Please rebase onto |
aneviaro
force-pushed
the
fix/arm-nsg-rules
branch
from
November 20, 2026 10:21
4efe4ed to
c85f64e
Compare
4 of 6 tasks
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 adapter read only top-level
Microsoft.Network/networkSecurityGroups/securityRulesresources, and gave each of them to every NSG in the template. Rules in the NSG'sproperties.securityRules(the most common form) and rules declared as child resources were ignored.Now each NSG gets:
properties.securityRules;securityRuleschildren, nested or top-level with a<nsg name>/<rule name>name, throughGetChildResources.A top-level rule whose name or NSG name is an expression goes to an NSG with unmanaged metadata, like orphan rules in the Terraform adapter. The rule checks still report it.
The
emptyandcompletetest cases declared an NSG and a top-level rule without names, so the rule now goes to the orphan group. I gave them the namesnsgandnsg/rule, so the cases still test how rule properties are mapped on a managed group.Before and after, scanning the template from #11655 (
trivy config --skip-check-update .):AZU-0048 (RDP from the internet) fires the same way for an inline rule on port 3389.
Related issues
Checklist
🤖 Generated with Claude Code