Skip to content

ACL rule API returns wrong results for ipv6 addresses #3596

Description

@gstorme

Describe the bug
GET /api/v1/acl/rule/{id} returns wrong results for IPv6 addresses.
The prefix length is not included when the prefix is a /32.
Because of this, when doing a PUT with the returned results, it changes the /32 into a /128 address

To Reproduce
Create an ACL rule with an IPv6 and /32 prefix in the manual destinations
GET /api/v1/acl/rule/{id}

Expected behavior
The addresses contains the correct prefix length for all IPv6 entries, or only strips the prefix in case of a /128

Version information

  • Defguard Core version: v2.0.2

Additional context
The logic probably comes from IPv4, because it has the same behaviour.
When you input 1.2.3.4/32 in the UI, the API only returns 1.2.3.4
For IPv4 addresses this isn't an issue, but it is for IPv6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status
    New

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions