mwood77 / pf2opn

An in-browser pfsense to opnsense converter.
https://www.pf2opn.com
Other
88 stars 7 forks source link

Firewall sections with multiple entries not converted correctly #22

Closed madscientist159 closed 5 months ago

madscientist159 commented 5 months ago

PFsense and OPNsense differ in how multiple entries (e.g. in an alias block) are formatted.

PFsense:

        <alias>
            <name>DescriptiveAliasNameGoesHere</name>
            <type>host</type>
            <address>192.168.1.0/24 192.168.2.0/24 192.168.3.0/24 192.168.4.0/24</address>
            <descr></descr>
            <detail><![CDATA[Entry added Fri, 01 Jan 1979 01:23:45 -0000]]></detail>
        </alias>

OPNsense:

          <alias uuid="abcdef12-3456-789a-bcde-f0123456789a">
            <enabled>1</enabled>
            <name>DescriptiveAliasNameGoesHere</name>
            <type>network</type>
            <proto/>
            <interface/>
            <counters/>
            <updatefreq/>
            <content>192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
192.168.4.0/24</content>
            <categories/>
            <description/>
          </alias>

pf2opn doesn't reformat the data in the address block, leading to a very subtle problem -- OPNsense appears to import the data correctly (and shows what appears to be a correct IP listing on the administration panel), but actually treats the IPs as a long text string (i.e. alias) instead of a list of separate IPs.

mwood77 commented 5 months ago

I'll address this issue first as it appears more pressing.

I've added a dedicated mapper to handle the parent <aliases> and <alias> tags in #23 .

If you're willing to check the output, you can try the development branch here:

mwood77 commented 5 months ago

23 has now been merged, so I'm going to close this issue. If the issue persists, please re-open this.