Skip to content

fix component alias ranges being ignored#2247

Merged
wojcik91 merged 7 commits intomainfrom
component_alias_range_fix
Mar 10, 2026
Merged

fix component alias ranges being ignored#2247
wojcik91 merged 7 commits intomainfrom
component_alias_range_fix

Conversation

@wojcik91
Copy link
Copy Markdown
Contributor

@wojcik91 wojcik91 commented Mar 10, 2026

Address ranges in component aliases are not being processed correctly - they are collected, but then ignored when generating a firewall rule.

Also bump version and dependencies in preparation for a bugfix release

Resolves #2261

@wojcik91 wojcik91 self-assigned this Mar 10, 2026
@wojcik91 wojcik91 marked this pull request as ready for review March 10, 2026 11:00
@wojcik91 wojcik91 requested a review from Copilot March 10, 2026 11:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates enterprise firewall rule generation to include component-alias destination ranges when computing destination addresses, and adds regression tests for mixed IPv4/IPv6 and range-merging behavior. Also bumps defguard_common crate version and refreshes Rust/Nix lockfiles.

Changes:

  • Merge component alias destination ranges into ACL rule destination range processing during firewall rule generation.
  • Refactor destination address processing to share range-handling logic between ACL rules and aliases.
  • Add SQLx tests covering IPv6 range + IPv4 manual destination and merging of rule/alias destination ranges.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/defguard_core/src/enterprise/firewall/mod.rs Merges alias destination ranges into destination processing; refactors range handling into a shared helper.
crates/defguard_core/src/enterprise/firewall/tests.rs Adds helper to insert rule destination ranges and adds regression tests for mixed-stack/range merging.
crates/defguard_common/Cargo.toml Bumps internal crate version to 1.6.5.
Cargo.toml Updates workspace dependency version for defguard_common to 1.6.5.
Cargo.lock Dependency lock refresh consistent with version bump and updated crates.
flake.lock Updates pinned nixpkgs and rust-overlay revisions/hashes.
Comments suppressed due to low confidence (1)

crates/defguard_core/src/enterprise/firewall/mod.rs:500

  • ipv4_dest_ranges/ipv6_dest_ranges are Vec<RangeInclusive<IpAddr>>, but Iterator::chain expects an iterator. As written, .chain(ipv4_dest_ranges) / .chain(ipv6_dest_ranges) will not compile; use .into_iter() (or keep them as iterators) when chaining.
    // combine iterators
    let ipv4_dest_addrs = ipv4_dest_net_addrs.chain(ipv4_dest_ranges).collect();
    let ipv6_dest_addrs = ipv6_dest_net_addrs.chain(ipv6_dest_ranges).collect();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

j-chmielewski
j-chmielewski previously approved these changes Mar 10, 2026
@wojcik91 wojcik91 merged commit 26ddd39 into main Mar 10, 2026
7 checks passed
@wojcik91 wojcik91 deleted the component_alias_range_fix branch March 10, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alias destination ranges are ignored

3 participants