Prohibit adding aliases containing FQDNs in static routes
aliases containing FQDNs cannot be used in static routes, need input validation to prevent that config from being used.
Revert "Fix alias expand for hostnames, it should fix #2941"
Working on a better fix
This reverts commit 0d59cc942f2ee225eccdb375e25f58a6f04fa9c4.
Make sure an alias is not used by a static route before delete, ticket #2941
Do not allow to add nested alias containing FQDNs when current alias is used on a static route, ticket #2941
Fix checkes for nested aliases containing FQDNs on static routes. It fixes #2941
#5 Updated by Josh Stompro about 7 years ago
I'm trying to confirm that this is fixed but I'm not having success. May 2nd 2.1 snapshot, well past when the change was made.
I create an alias with a single host FQDN, save it and apply the change. Then I go to the System Static Routes and add a route using that Alias. And the process completes without any trouble, no error is displayed.
I then deleted the route, and I went back to my alias and changed it to a network alias with a FQDN entry. And I could still use it in a static route.
Maybe I'm not testing the correct thing, could someone describe how to trigger this problem.
Here are the alias and static route config entries.
<route> <network>Testing</network> <gateway>Openvpn</gateway> <descr><![CDATA[test]]></descr> </route> <alias> <name>Testing</name> <address>firewall.larl.org</address> <descr><![CDATA[testing]]></descr> <type>network</type> <detail><![CDATA[larl.org]]></detail> </alias>
#14 Updated by Josh Cavalier about 7 years ago
I have tested this with the latest build and it works as intended. I created two aliases, one with a FQDN and one with an IP4 IP. I could add the IP alias but not the FQDN alias. Error message is "The alias (test1) has one or more FQDNs configured and cannot be used to configure a static route."
#15 Updated by Josh Cavalier about 7 years ago
Also, I have replicated the test by Josh Stompro above (changing an existing alias used by a static route from IP to FQDN) and firewall_aliases_edit.php now responds with "This alias is used on a static route and cannot contain FQDNs".