Friday, April 30, 2021

fortios upgrade from usb

 In some rare instance you might have to upgrade a fortigate from usb. This can be due to numerous reasons


proxy

inside firewall access

a closed system from the internet

etc...


So here's the basic steps


A> read the release notes. This will help you to know what changed , fixes, improvements.


B> study any migration path


C> make a backup configuration 




D> clear the debug config error




E> copy the image to a ms-dot formatted usb-stick



F> start the upgrade





G> check status and read any diag debug config errors






And lastly, you have two partitions, you can always revert back to the inactive partition if you want to reboot in previous  installed version








NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com
     ^      ^
=(  @  @ )=
         o

        /  \




Friday, April 23, 2021

ipv6 sit-tunnel using https://www.tunnelbroker.ch/

 So an alternative to hurricane electric is https://www.tunnelbroker.ch/

The advantage here are;


  1.    the user interface is much better design
  2.    A API is available


disadvantage 

  1.    the free account only offers a /64
  2.    you can only craft 3  upto 3 tunnels in the free offering 
  3.   total number of end-point regions is much less than hurricane electric


Here's a few snapshots of the portal


API


ipv6 tunnel details



Fortios cfg





 Ping check from keycdn tools



And traceroute source from the /64 for testing;



YMMV but this is an exceptional tunnelbroker for ipv6.

note: their auto-cfg generator for fortios is incorrect {config system sbtb-tunnel}

     








NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com
     ^      ^
=(  @  @ )=
         o

        /  \


Thursday, April 22, 2021

ipv6 sit-tunnel using Hurricane Electric

 So you want to try ipv6 but your local provider has no IPv6 capabilities. Use the Hurricane Electric tunnelbroker and build a sit tunnel. HurricaneElectric https://tunnelbroker.net/

1st lets understand what SIT means.


Okay that's what SIT tunnel means and does. So on to the HE tunnel broker the request is simple to execute just make sure the ipv4 outer address on your fortigate is allowing pings.


HE tunnel assignment with a /48 allocation;


Okay now that you have the HE pieces, you can configure the fortios settings. Since I want to test the /48 allocation, I will assign a /64 subnet to a loop back and configure it for icmp6 and a firewall policy. Keep in mind since fortios0 6.4 ipv4/ipv6 policy are now done from with the same hierarchy from the CLI. no more "config firewall polic6"
 
sys sit-tunnel cfg and loopback ( notice allowaccess ping was set ) 






A firewall policy to allow for my testing ;



Okay let's looking over ipv6 route table and do some basic checks


here's  some ping6 and traceroute6  test using the fortigate and loopback address;




Here's me testing from KeyCDN tools for simultaneous pings/traceroutes








 


This was all done on a FGT100E  and with an attach with a tunnel endpoint in EU region.



So to recap, ipv6 support is great in fortios. If you need ipv6 connectivity and your provider does not support ipv6, just use the tunnel services from HurricaneElectric https://tunnelbroker.net/

HE will give you the option to create up to 5  unique sit-tunnels.










NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com
     ^      ^
=(  @  @ )=
         o

        /  \

Wednesday, April 7, 2021

ansible and napalm to get your fortios configuration

 With naplam-fortios you have numerous means to login and do certain commands within fortios. The supported command are listed at the following link below

https://napalm.readthedocs.io/en/reunification/support/index.html#getters-support-matrix


Here's a simple play to gather the fortios config;



- name: fgtconfig
 hosts:  firewall1
 connection: local  
 gather_facts: no  
 vars_prompt:
  - name: password
   prompt: "password please"
  - name: admin
   prompt: "username please"
   private: no
 tasks:                   
  - name: getConfigDevice      
   napalm_get_facts:          
    username: "{{ admin }}"        
    dev_os: 'fortios'        
    password: "{{ password }}"      
    filter: 'config'        
   register: result        
  - name: print results       
   debug: msg="{{ result }}"


Here's an example for gather fwpolicies which is great if you want to do audits.


tasks:
  - name: get fwpolices from device
   napalm_get_facts:
    username: "{{ admin }}"
    dev_os: 'fortios'
    password: "{{ password }}"
    filter: 'firewall_policies'
   register: resultfwpol
  - name: print results
   debug: msg="{{ resultfwpol }}"


A sample output;



A fgt collection play



- name: fgtcollections
 hosts: fgt1
 connection: local  
 gather_facts: no  
 vars_prompt:
  - name: password
   prompt: "password please"
  - name: admin
   prompt: "username please"
   private: no
 tasks:                   
  - name: get facts from device      
   napalm_get_facts:          
    username: "{{ admin }}"        
    dev_os: 'fortios'        
    password: "{{ password }}"      
    filter: 'config'        
   register: result        
  - name: print results       
   debug: msg="{{ result }}"     
 tasks:
  - name: get fwpolices from device
   napalm_get_facts:
    username: "{{ admin }}"
    dev_os: 'fortios'
    password: "{{ password }}"
    filter: 'firewall_policies'
   register: resultfwpol
  - name: print results
   debug: msg="{{ resultfwpol }}" 
 tasks:
  - name: get interface_counters from device
   napalm_get_facts:
    username: "{{ admin }}"
    dev_os: 'fortios'
    password: "{{ password }}"
    filter: 'interfaces_counters'
   register: counters
  - name: print results
   debug: msg="{{ counters }}"


You can do a host of items if supported in the  napalm module but napalm is limited. 


The fortios API is a better approach since it's documented very well and has a host of options for add/delete/change of configurations pieces.


YMMV







NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com
     ^      ^
=(  @  @ )=
         o

        /  \

Thursday, March 18, 2021

Postquantum Security IKEv2 PPK fortios

 In this blog you will see a simple PPK deployment to ensure PSK are not crackable. 

1st PPK is a IKEv2 feature

2nd you can make it option or mandatory in the fortios . This allows for a simple PSK and the choice of enforcing PPK


here's the fgt1 cfg



the 2nd fgt is exactly the same in this the fgt1 is a dynamic-ipsec peer




To verify PPK was used run the "diag vpn ike gateway" cmd from cli




To craft a strong ppk-secret is suggest 64 characters or more. Openssl or python can be used for this. Just make it random.




or




$ cat ran.py

import random

import string


ppk = [random.choice(string.ascii_letters + string.digits) for n in xrange(64)]

str = "".join(ppk)


print str










NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com
     ^      ^
=(  @  @ )=
         o

        /  \


Monday, March 8, 2021

ipv6 policy in 6.4

 

A friend of mine freaked out when he loaded 6.4 fortios and found out that firewall policy6  are no longer an option.

fortios 6.4


fortios 6.2



A sample ipv6 policy within fortios 6.4 "config firewall policy" hierarchy .



Now for  the million down question;    if you upgrade from fortios6.2 and have "firewall policy6"  policies  are they automatically converted and carried over to "firewall policy" policies ?

So  if you have auto policy scripts, these will need to be rewritten if you upgrade to 6.4.x fortios version .




Ken Felix 

NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com
     ^      ^
=(  @  @ )=
         o

        /  \



Friday, February 19, 2021

My top things that I hate about juniper SRX firewall

My top things that I hate about juniper SRX  

1: junos software updates are slow. The SRX or any juniper device as far as that goes, is extremely slow and tedious to do any software updates

2: No means to restrict  concurrent -sessions per firewall policy, no means for simple deployment of GEO polices, no blacklist subscription service without additional license features

3: No means to enforce tcp-mss  per firewall policy

4: packet-captures operations requires you to actually make changes to the configuration in order to do a simple pcap  creation

5: No easy way to do many  ipsec-tunnel creations

6: Configurations of ipsec-tunnels are tedious and time consuming process

7: Still no WCCP intercept for proxy integration. The normal junos solution for transparent use a non-WCCP solution that is a hocus pocus route-rib, filter, event monitors, and a host of other items to get it to work. JUNPR get over the fact that cisco was the previous designer and support of WCCP. WCCP is what we should have and be doing.

8:  Layer2 Virtual-wirepairs are not a feature current or on any forecast 

9: SDWAN is not a simple feature to deploy and requires specific srx-model and with additional license

10: Simple on board proxy for web/ftp is not available

11: AV/DLP/IPS/IDP deployment is clumsy and more difficult then other firewalls to deploy

12: PBR deployments for specific routing needs is not easily doable

13: My final item, simple server-load-balance DNAT vips are not a supported feature




Ken Felix 

NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com
     ^      ^
=(  @  @ )=
         o

        /  \