Skip to main content
IShall
New Member
Apr 14, 2015 1:39 AM UTC
Question

Validating firewall address objects

Hello,

Just wondering if anyone has managed to export Fortigate address host objects and ip addresses to a text file or csv etc ?

What I am really trying to achieve is to identify any inconsistencies in the address objects where either the host no longer exists or where the ip has been reallocated to a different host. So the process would be to identify any address object with a 255.255.255.255 mask, do a DNS lookup, try to ping it etc and report on this.

 

If I could extract the address and ips then I could probably do the rest in a bash script or something, but I imagine someone has already done the initial extraction part ? I've found the perl script to extract the policies into a .csv, but I'm not a perl guy, so if someone has done this already, that would be very useful.

 

Thanks in advance,

 

Fortigate 310B

Fortimanager 400A

Fortianalyzer 200D

 

    4 replies

    Somashekara_Hanumant
    Staff & Editor
    Staff & Editor
    Apr 14, 2015 5:17 AM UTC

    Hi IShall,

     

    From the CLI console  you can save the firewall address objects to a file

     

    Open ssh session with fortigate using putty.exe and log all the output to a file (Session > Logging > All session output > Log File name > save the file as *.log)

    config firewall address

    sh full

    end

     

    all the output will be saved on a text file.

     

    let me know if you have any further queries.

     

    Regards,

    Somu

    Translate
    Somashekara_Hanumant
    Staff & Editor
    Staff & Editor
    Apr 16, 2015 5:23 AM UTC

    Hi IShall,

     

    using below command you can list the address object with 255.255.255.255 mask

     

    sh firewall address | grep "255.255.255.255"

     

    Hope this helps you.

     

    Regards,

    Somu

    Translate
    IShall
    IShallAuthor
    New Member
    Apr 15, 2015 10:07 PM UTC

    Thanks Somu,

    Certainly that is the starting point. What I am aiming to do is extract the host objects (i.e. address object with type "ipmask" and mask "255.255.255.255") and further process just these. So I'll need some scripting to do that.

    Regards,

    Translate
    emnoc
    New Member
    Apr 16, 2015 8:26 AM UTC

    Yeas and with the -A  you ca get the full name;

     

     show firewall address | grep -A 4 "255.255.255.255"

     

    You will still need to manipulate the items to  find any duplicates or unused address or address-groups. Than you can cross reference these to  active policies.

     

    I'm sure you could write a script parser to find all occurrence of "named address" to the policies.

     

    Translate
    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024