-
Notifications
You must be signed in to change notification settings - Fork 174
Fix firewall rule validation error and enable descriptions for both network and application rules #4694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
|
@copilot looking at https://learn.microsoft.com/en-us/rest/api/virtualnetwork/firewall-policy-rule-collection-groups/create-or-update?view=rest-virtualnetwork-2024-07-01&tabs=HTTP#networkrule description is supported for both application and network rules, and is supported in terraform, its should not be deprecated. Also ensure where no description is given in template schema, the name is used for the terraform. Blank values, "", are not allowed if used the schema should fail validation, |
…name as fallback Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Updated to enable descriptions for both network and application rules. When no description is provided or it's an empty string, the rule name is now used as the description. This ensures all rules have meaningful descriptions while preventing validation errors. Changes in commit 7cc3467 (short hash will update after push). |
|
@copilot also update templates/shared_services/firewall/template_schema.json |
Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Updated template_schema.json to:
This ensures schema validation prevents empty strings from being submitted, while the Terraform code uses the rule name as fallback when description is not provided. Changes in commit 12ea9a4. |
|
/test d222c32 |
|
🤖 pr-bot 🤖 🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/18380188201 (with refid (in response to this comment from @marrobi) |
|
@copilot fix terraform fmt -check -recursive |
Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Fixed Terraform formatting by removing extra alignment spacing on the Changes in commit 8c8f281. |
|
/test-destroy-env Passed |
|
/test-force-approve Passed: https://github.com/microsoft/AzureTRE/actions/runs/18380188201 |
|
🤖 pr-bot 🤖 ✅ Marking tests as complete (for commit d576eea) (in response to this comment from @marrobi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes firewall rule validation errors that occur when rule descriptions are empty strings and standardizes description handling across both network and application rules.
- Enables descriptions for network rules and implements consistent fallback logic for both rule types
- Updates schema validation to reject empty strings while making descriptions optional
- Bumps firewall service version to 1.6.0 with appropriate documentation updates
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| templates/shared_services/firewall/terraform/rules.tf | Enables descriptions for network rules and adds fallback logic using rule name when descriptions are empty |
| templates/shared_services/firewall/template_schema.json | Removes default empty strings and updates pattern validation to reject empty descriptions |
| templates/shared_services/firewall/porter.yaml | Bumps version from 1.5.0 to 1.6.0 |
| docs/tre-workspace-authors/firewall-rules.md | Updates documentation to clarify description fallback behavior |
| CHANGELOG.md | Adds entry for the firewall validation fix |
Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
JC-wk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using this now and it's working perfectly for me
|
@tamirkamara can you take a look at this? Think it's good to go. Thanks. |
|
/test-force-approve Passed: https://github.com/microsoft/AzureTRE/actions/runs/18380188201 |
|
🤖 pr-bot 🤖 ✅ Marking tests as complete (for commit 7dc2119) (in response to this comment from @marrobi) |
Fix firewall rule validation error and enable descriptions for both network and application rules
This PR addresses the issue where firewall rule descriptions can be empty strings, causing Terraform validation errors.
Changes Completed:
Technical Details:
Problem: When deploying firewall rules via template_schema.json, if a rule's description is an empty string or not provided, it could cause validation errors.
Solution:
Terraform Code (
templates/shared_services/firewall/terraform/rules.tf):description = try(length(trimspace(rule.value.description)) > 0 ? rule.value.description : null, null)Schema Validation (
templates/shared_services/firewall/template_schema.json):default: ""from both rule types (description is now optional)^.*$to^.+$to reject empty stringsDocumentation (
docs/tre-workspace-authors/firewall-rules.md):Versioning:
Behavior:
Impact:
Fixes #4691
Original prompt
Fixes #4691
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.