Skip to content
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

Nested aliases are not being allowed with PUT /api/v2/firewall/aliases #619

Closed
jaredhendrickson13 opened this issue Dec 18, 2024 · 0 comments · Fixed by #618
Closed

Nested aliases are not being allowed with PUT /api/v2/firewall/aliases #619

jaredhendrickson13 opened this issue Dec 18, 2024 · 0 comments · Fixed by #618
Labels
bug Something isn't working

Comments

@jaredhendrickson13
Copy link
Owner

Describe the bug

When replacing all firewall aliases using PUT /api/v2/firewall/aliases, nested aliases are not being allowed even when the referenced alias was validated and set in the config earlier in the call.

To Reproduce

Run curl -s -k -u admin:pfsense -X PUT https://localhost/api/v2/firewall/aliases -H "content-type: application/json" -d '[{"name": "test_alias_1", "type": "host", "address": []}, {"name": "test_alias_2", "type": "host", "address": ["test_alias_1"]}]'

Expected behavior

Nested aliases should be allowed.

Screenshots or Response

If applicable, add screenshots or response data to help explain your problem.

pfSense Version & Package Version:

  • pfSense Version: CE 2.7.2
  • Package Version v2.2.2

Affected Endpoints:

  • PUT /api/v2/firewall/aliases

Additional context

This seems to be caused by the pfSense is_ipaddroralias and is_port_or_range_or_alias functions not fetching changes to the configuration between each validation. We should either force a config reload between objects or use a different method to determine if a nested alias is being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant