Fortinet has always been a leader with regards to application identification statistics. In this post we will look at obtain statistical information by using the diag stat command from the cli.
The command has a limited set of options;
DAFWFGT800 # diag stat
app-bandwidth applications by bandwidth of last minute
app-stat-clear clear application statistics
app-usage-ip per ip usage of application
per-ip-bw top bandwidth by IP address
Typically one will execute the app-bandwidth to get a general overview of traffic statistics.
e.g
Note: I highlighted a few fields such as ;
application id
sessions counts
bps
application name
With this diag cmd, you can specify the app-id if known for statis on that application.
With the count option, you can now get statistics by address.
By using the per-ip option we can list of the top talkers;
This command can be creative and helpful with traffic status and counts.
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( @ @ )=
o
/ \
Monday, September 15, 2014
A look at EAS
So far in all of my security posts, has
been network and/or security related. This one speaks of a gig that I just finished
from a pen-test project that was conduct
against a major retail operation. A friend of mine, hired me on as a augmenter to a team of
pen-testers, for a project that was currently
under way.
I came on initially for
network penetration testing and firewall policies review. Since the project had
a requirement for conducting site physical security test and penetration, I was able to suggest
to the project manager , if we could include product security; “as in anti-theft preventive measures”.
This ideal was suggested to the customer, who immediately liked it and
after a 1 hour conference call, we laid out the ground rules and restrictions;
· No armed robbery (yes I’m not joking here, no physical
confrontation with anybody to include loss-prevention personnel or customers)
· No tampering with any EAS tags
· No tampering with any EAS monitor gear ( aka
transceivers)
· No
tampering with the packing material of any device that has a embedded EAS tag
· Items
must be at least $100.00 USD or more in value to be considered for this project
Okay that looks
simple, right ?
Will let’s back up some and explain the whole EAS tags concept
and retail-theft and the flaws within.
Retail theft is always a problem with a host of stores thru
out the world. Product are always stolen, and various department stores are always
deploying various means for reducing theft. Some install cameras thru out the
store’s public and private areas, others place security guards at entrance and
exits, some even place door-open-alarms if open,
and lastly others trust the EAS
systems.
EAS stands for Electronic Article Surveillance and primarily
& is used to track the smaller/high value products such as; a handheld electronic devices ( phone/tablets/memory/cameras/etc...) , CD/DVD, games cartridges, phones, etc….
These devices are typically coupled to a EAS tag or embedded in the packing
material of the item. They are typically less than the thickness of a
pen/pencil width and shorter than a human pinky finger in length.
How the EAS concept works;
· A product that's reviewed as being an high theft object, will under go a EAS insertion. The store
negotiate with a EAS vendor like TycoSensormatic ( who at one time I was employed as contractor in their IT/network dept). The vendor will provide an assortment of tags similar to these;
negotiate with a EAS vendor like TycoSensormatic ( who at one time I was employed as contractor in their IT/network dept). The vendor will provide an assortment of tags similar to these;
· Transceiver
devices are deploy at the entrances of the retailer store doors similar to the following;
When a tagged article that‘s actively armed & passes thru a
transceiver, a audio/flashing warning is emitted.
I know you have seen these devices and/or at least heard one go off.
They produce a buzz, chime, or siren. And in some cases, they briefly emits flashes or lights to alert store employees of an possible theft.
The retailer stores deploys these systems as deterrence to
theft, in a way similar to how a bank installs, security guards, dye packs,
cameras, bullet-proof glass and man traps, but yet banks are still always being
robbed and in some case the crooks are very successful ( makes one think ) .
Keypoint on history: At one time the Chicagoland was the bank robber
capital of the world , & with a bank being hit every week if nt every day, but back to the story at
hand.
Will back to our tagged articles of protection, the stores
tries to reduce theft, but in reality they are not 100% successful by a
long shot. Most stores will not publish data on just how many goods
are stolen yearly, but most choose to report only an estimated. Who really knows, we just know items are being stolen on a daily basis by both amauetur and professional thieves.
So in this gig, my goals was to prove that this particular retailer
outlet & their choice of anti-theft mechanism was fool proof or not. I was given
a list of 10 stores in the greater tri-county area that I resided in. Out of
these 10 sites, I picked 6 store that where going to be “hit” so to speak. And
didn’t let anybody know, and that including the pen-test leads nor customer or
any of there personnel.
I can’t disclose the store name or locations, but the sites
where scoped out for a few days & before my big event would take place. In
those few days, I recon'd the stores, and mentally selected the merchandise that
I was going to try to lift. I also probe
their EAS alarms systems to get an ideal of the employees reactions, and to validate the EAS gear was actually
working.
How I probed the stores was very easy. I purchase a few device at another
store ( that where not properly deactivated ) and removed the EAS tag from that
device, and used it to trigger the 6 selected
stores EAS detection systems. It took me a few tries to get a non deactivated
tag from my initial purchases, but when I found a few good ones, it was simple
just to walk in thru the store entrance, and with my trigger EAS tag in my
front shirt pocket. A couple of pass
thru the doors, will let you know if the systems was active.
In most cases the store employees did one of the following;
- · hardly raised their heads or barely looked my way
- · wave me on my way , as if nothing happen
- · or did absolutely nothing
The latter was what happen in almost eight out of ten times
in my probe testing of the retail stores 6 targets locations. They did nothing,
no challenge, and even to the point of no acknowledgement. I thought to myself ;
“ This is going to be easy”
All but one of the six stores, had working EAS transceivers,
so I skipped store #6 since the detection device was non-operative at the time
of my initial probe. How often do they actually monitor the function of these devices and provide Maintenance is questionable imho.
So on the day of my big event, I dressed up in a nice causal
polo & shorts, with my get out of jail paper, and drove to store number #1.
It was a fall/winter day and the time was approx. 10:00AM. I strolled around in store #1
for about 30mins, looking at this and that, and loading, up my cart with
big/heavy, & duplicate items. The goal was to lay the
item(s) of theft, under these bigger items. These items where going to do one
of two things;
- · shield the item from the EAS transceiver
- · or from visual eye sight, if it should go off
My planned worked like a charm. My 1st store was looted of one item
that weighed under 2lbs and cost approx
$132.00 usd.
I spent maybe 1 hour in that store total. The heavier items
where too much of a hassle for the checkout employee, to remove and reinsert
into my shopping cart. So she just scanned one item of the numerous/many that I had. I went to my next
4 targets, doing the exact same thing, but selecting another product to lift,
but using the same method as with store number 1.
In all, I was 5 out of 5, and at the conclusion of that day
or work, I had $687.82 USD of
goods. Not bad for a day of work.
Now can get an ideal of how organized retail theft rings work, and that the goods they lift typically ends up at a flea market, or pawn shop. At these place they are sold for a fraction of their face value. These organized pros targets stores like mine, and by lifting small items with no serial-numbers or with very hard means for tracking.
Now can get an ideal of how organized retail theft rings work, and that the goods they lift typically ends up at a flea market, or pawn shop. At these place they are sold for a fraction of their face value. These organized pros targets stores like mine, and by lifting small items with no serial-numbers or with very hard means for tracking.
Now you can see that EAS systems are not effective be any
means. In all of the 5 stores, and not counting the one with a broken, or
non-operative transceiver, I was not challenge by any store personnel. In store
#5, they even had a renta-security-guard at the door, and she barely raised her
head when the alarm went off, since she her attention was directed at her
smartphone, and the reading of a text or email.
I will say this;
“ the alarms did trigger in all cases, but the culture of enforcement was broken
by the employees ”.
So one can say the systems operated as designed, but it was
the employees fault. But overall the EAS systems was not 100% in the prevention
of theft. Only the honest person would be deterred by the EAS systems. Theirs
an ole saying that goes like this; “locks, only keeps out the honest persons”.
Will this holds true for the EAS systems.
Stores like office-depot for example, don’t bother to waste
time and money with these EAS protection devices. They choose the route of delaying the customer, by making him/her bring a inert
display item or box to the front counter, and to make them wait, while they call up an associated to retrieve the items of interest for purchasing. Or they stock certain items, upfront and
behind the front counter.
This is probably more effective, than a multi-thousand
dollar EAS systems and the 0.05-0.15 cent bulk pricing of the EAS tag that
either packaged, pinned or coupled to the device.
I hope you found this article useful.
Ken Felix
Freelance Security Network Guy
kfelix “ a t “
hyperfeed dot com
Saturday, September 13, 2014
A meshed transparent-vdom using inter-vdom-linik fortigate
In this post we will look at a layer2 stacked aka meshed vdom using a transparent vdom with a nat/routed-vdom.
This is setup is used when you have a network segments that needs firewall protection, but do not want to make any layer3 address changes. Please review previous meshed vdom here;
http://socpuppet.blogspot.com/2014/09/a-stacked-vdom-concept-with-fortigate.html
1st here's the topology;
As you can see custC vdom is operating in a transparent mode with just 2 interfaces. The vdom is tied to the root-vdom using a inter-vdom-link.
First let's build our vdom for the custC and set the operation mode.
config system settings
set comments "L2-vdom SOCPUPPETS example "
set opmode transparent
set manageip 10.199.199.2/255.255.255.0
end
Next we define one physical port into this custC-vdom. This could also have been an sub-interface ( 802.1q) on a trunk port.
config system interface
edit "internal3"
set vdom "custC"
set type physical
set alias "transparent interface inside"
next
end
Okay now we need to define a inter-vdom-link. Just like with the meshed routed vdoms, we place one side of the link into the root vdom, and the other end into our l2-transparent vdom.
To keep this simple, I named this link transparent.
config system vdom-link
edit "transparent"
set type ethernet
next
end
Tip, set the type as "ethernet" since we are going to bridge internal3 interfaces to it. The fortigate will also set ethernet mac_address that you can customized if you so desire. The default type is PPP.
Here's our inter-vdom-link name transparent0 and transparent1;
In true transparent installation & with real interfaces they typically will not have address assignment. Since this firewall instance is stacked behind another layer3 device ( root-vdom firewall ) we have a layer3 interface addressed which is the gateway for lan 10.199.199.0/24.
Now we can rock & roll.
1st we need to jump into the root-vdom and build our policy. We are going to simply allow all traffic and SNAT it via a interface overload on the WAN link.
( vdom root firewall policy )
config firewall policy
edit 0
set srcintf "transparent0"
set dstintf "virtual-wan-link"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set nat enable
end
Next, we will create a dhcp-server within the root vdom to dynamically assigned address to the layer2 vdom ( optional )
config sys dhcp server
edit 88
set dns-service default
set default-gateway 10.199.199.1
set netmask 255.255.255.0
set interface "transparent0"
config ip-range
edit 1
set start-ip 10.199.199.10
set end-ip 10.199.199.20
next
end
That pretty much takes care of our root-vdom configurations. Now we will switch to the custC vdom and place an address statements for the dhcp-server and local lan and a firewall policy
( custC vdom address and firewall )
config firewall address
edit "dhcp-server"
set comment " transparent dhcp server "
set subnet 10.199.199.1 255.255.255.255
next
edit "10_199_199_0-NET"
set comment "my local lan within the l2 domain socpuppets http://socpuppet.blogspot.com "
set subnet 10.199.199.0 255.255.255.0
next
end
and our firewall policy;
config firewall policy
edit 1
set srcintf "internal3"
set dstintf "transparent1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
next
edit 2
set srcintf "transparent1"
set dstintf "internal3"
set srcaddr "dhcp-server"
set dstaddr "all"
set action accept
set schedule "always"
set service "DHCP"
next
end
Ensure that you secure the required firewall policies that you need for both directions.
Make sure you create a policy to allow traffic from outside to internal if your dhcp-server is hosted on the outside.
And finally we execute a trace route to ensure that all works;
Vdoms & inter-vdom-links can be fun and challenging. Departmentalizing the fortigate firewall is a feature that can be used for dedication of resources and relinquishing operations and controls to a sub administration.
keep points
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( @ @ )=
o
/ \
This is setup is used when you have a network segments that needs firewall protection, but do not want to make any layer3 address changes. Please review previous meshed vdom here;
http://socpuppet.blogspot.com/2014/09/a-stacked-vdom-concept-with-fortigate.html
1st here's the topology;
As you can see custC vdom is operating in a transparent mode with just 2 interfaces. The vdom is tied to the root-vdom using a inter-vdom-link.
First let's build our vdom for the custC and set the operation mode.
config system settings
set comments "L2-vdom SOCPUPPETS example "
set opmode transparent
set manageip 10.199.199.2/255.255.255.0
end
Next we define one physical port into this custC-vdom. This could also have been an sub-interface ( 802.1q) on a trunk port.
config system interface
edit "internal3"
set vdom "custC"
set type physical
set alias "transparent interface inside"
next
end
Okay now we need to define a inter-vdom-link. Just like with the meshed routed vdoms, we place one side of the link into the root vdom, and the other end into our l2-transparent vdom.
To keep this simple, I named this link transparent.
config system vdom-link
edit "transparent"
set type ethernet
next
end
Tip, set the type as "ethernet" since we are going to bridge internal3 interfaces to it. The fortigate will also set ethernet mac_address that you can customized if you so desire. The default type is PPP.
Here's our inter-vdom-link name transparent0 and transparent1;
In true transparent installation & with real interfaces they typically will not have address assignment. Since this firewall instance is stacked behind another layer3 device ( root-vdom firewall ) we have a layer3 interface addressed which is the gateway for lan 10.199.199.0/24.
Now we can rock & roll.
1st we need to jump into the root-vdom and build our policy. We are going to simply allow all traffic and SNAT it via a interface overload on the WAN link.
( vdom root firewall policy )
config firewall policy
edit 0
set srcintf "transparent0"
set dstintf "virtual-wan-link"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set nat enable
end
Next, we will create a dhcp-server within the root vdom to dynamically assigned address to the layer2 vdom ( optional )
config sys dhcp server
edit 88
set dns-service default
set default-gateway 10.199.199.1
set netmask 255.255.255.0
set interface "transparent0"
config ip-range
edit 1
set start-ip 10.199.199.10
set end-ip 10.199.199.20
next
end
That pretty much takes care of our root-vdom configurations. Now we will switch to the custC vdom and place an address statements for the dhcp-server and local lan and a firewall policy
( custC vdom address and firewall )
config firewall address
edit "dhcp-server"
set comment " transparent dhcp server "
set subnet 10.199.199.1 255.255.255.255
next
edit "10_199_199_0-NET"
set comment "my local lan within the l2 domain socpuppets http://socpuppet.blogspot.com "
set subnet 10.199.199.0 255.255.255.0
next
end
and our firewall policy;
edit 1
set srcintf "internal3"
set dstintf "transparent1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
next
edit 2
set srcintf "transparent1"
set dstintf "internal3"
set srcaddr "dhcp-server"
set dstaddr "all"
set action accept
set schedule "always"
set service "DHCP"
next
end
Ensure that you secure the required firewall policies that you need for both directions.
Make sure you create a policy to allow traffic from outside to internal if your dhcp-server is hosted on the outside.
And finally we execute a trace route to ensure that all works;
Vdoms & inter-vdom-links can be fun and challenging. Departmentalizing the fortigate firewall is a feature that can be used for dedication of resources and relinquishing operations and controls to a sub administration.
keep points
- be careful of the inter-vdom links numberings
- transparent operations are just that "transparent"
- firewall policies for all traffic flows needs to be build across vdoms
- look at each vdom as a firewall that unique that happens to sit in the same physical hardware
- leverage 802.1q tagging to avoid port exhausting
- HA clustering and vdom balancing can be a plus for A-P operations
- All interfaces have the ability for ; packet dump, allowaccess, if-index, netflow/sflow,etc......
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( @ @ )=
o
/ \
Friday, September 12, 2014
A meshed routed-vdom concept with fortigate
In this post we will look at a stacked ( meshed ) vdom routed concept. This is a means for the creation of vdoms for departmental isolation and with a share vdom that routes our traffic to the public wan.
1st what is a vdom ?
1st here's the topology;
Vdom ROOT ( RED ) is our public facing virtual firewall that has access to the internet backbone.
Vdom custA & custB are stacked behind the Root-Vdom and relies on the root-vdom for all internet access. You can look at this as a firewall behind another firewall. In the above drawing, I placed one physical interfaces for the local lan subnets in each customer side vdom.
This concept is used in a lot of hosted of enterprise communities. The number of possible vdoms would be determine by the chassis type and possible the number of physical interfaces you consume for a vdom. We will use both real and virtual interfaces in this example for the 3 vdoms shown.
Root = WAN virtual-link, vlinkcustA2root and vlinkcustB2root,
custA = PORT1 , vlinkcustA2root
custB = PORT2 , vlinkcustB2root
The custA & custB will use these virtual-links as the gateways to internet. These interfaces could have been etherchannels , Wifi-interfaces, or 802.1q tagged subinterfaces. Each vdom custA&B have dhcp-sys-services installed for dynamic allocation.
I like to call this vdom setup a "stacked" approach.
Okay now let's build this out. The setup is quite simple, but the 1st time you stumble into the fortinet vdoms world you might want to build a checklist of things to look at and do B4 you start.
NOTE: the organizing of your design & thoughts, can save a lot of time, create less confusing, and reduce errors/mistakes
So plan ahead for the proposed design.
Okay let put some /30 address on the vlinks that we will use for the 2 customer vdoms ( custA custB )
vlinkcustA2root 192.168.10.0/30 ( .1 + .2 )
vlinkcustB2root 192.168.10.4/30 ( .5 + .6 )
1step assuming your already in vdom cfg mode and have set the firewall up with vdom enabled.
note: All fortigate appliance minus the smaller SOHO have the capability to install upto 10vdoms each. With the bigger chassis you can install vdom license for 10< vdom
config sys global
set vdom-admin enable
end
We 1st build the additional vdoms named ; custA and custB
config vdom
edit custA
next
edit custB
end
2nd step
We define these interfaces port1 and port2 for these vdoms custA and custB respectively
config global
config sys interface
edit interna1
set vdom custA
next
edit internal2
set vdom custB
end
NOTE: You have to have the vdom created before you can place a interface into it.
3rd
Okay now, we will apply our virtual-links cfgs. These are our virtual WAN-uplinks. This is used for inter-vdom traffic ( traffic between vdoms ) and can be looked at as a real interface except it's really virtual. Your clients would not know the difference btw. For all purpose it's a interface. So you can do packet captures, allowaccess, build firewall rules, etc....
Each vlink will have one side addressed in the root-vdom and other side in the customer vdom. The sub numbers will end in a 0 and 1 as shown in the system interfaces. make sure you pay very good attention to the numbers and where you assign them and the address. In this post the Zero ( 0 ) will be in Root and One ( 1) will be in the customer vdom.
( vdom interlink creation )
config system vdom-link
edit "root2custA"
next
edit "root2custB"
next
end
( vdom interlink address config sys interfaces )
edit "root2custA0"
set vdom "root"
set ip 192.168.10.1 255.255.255.252
set allowaccess ping
set type vdom-link
set snmp-index 22
next
edit "root2custA1"
set vdom "custA"
set ip 192.168.10.2 255.255.255.252
set allowaccess ping
set type vdom-link
set snmp-index 25
next
edit "root2custB0"
set vdom "root"
set ip 192.168.10.5 255.255.255.252
set allowaccess ping
set type vdom-link
set snmp-index 27
next
edit "root2custB1"
set vdom "custB"
set ip 192.168.10.6 255.255.255.252
set allowaccess ping
set type vdom-link
set snmp-index 28
next
4th, after you have the vlink installed and configured, we will start the vdom policy configurations. These are simple to configured and you will need policies in ALL vdoms for allowing the traffic flows.
( root firewall address + policies )
config firewall address
edit "custA"
set uuid a435f472-39f9-51e4-3f01-2f63d976cc44
set subnet 10.100.10.0 255.255.255.0
next
edit "custB"
set uuid ad656096-39f9-51e4-0d06-ee9f8c992982
set subnet 10.200.10.0 255.255.255.0
next
end
config firewall policy
edit 0
set srcintf "root2custA0"
set dstintf "virtual-wan-link"
set srcaddr "custA"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set nat enable
next
edit 0
set srcintf "root2custB0"
set dstintf "virtual-wan-link"
set srcaddr "custB"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set nat enable
next
end
( custA firewall address and policies )
config firewall policy
edit 1
set srcintf "internal1"
set dstintf "root2custA1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set comments "custA-outbound"
next
end
( and finally custB )
config firewall policy
edit 1
set srcintf "internal2"
set dstintf "root2custB1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set comments "custB-outbound"
next
end
NOTE: we are allowing all traffic with no nat enabled, NAt overload will be configured in the root vdom
5th, you need routing for traffic entering and exiting the vdoms and for the root-vdom to route traffic to the local subnets
( custA static route )
config router static
edit 1
set device "root2custA1"
set comment "default custA"
next
end
(custB static route )
config router static
edit 1
set device "root2custB1"
set comment "default custB"
next
end
( root vdom static route to the customer vdom subnets using the inter-vdom-links )
config router static
edit 1002
set dst 10.200.10.0 255.255.255.0
set gateway 192.168.10.6
set device "root2custB0"
next
edit 1001
set dst 10.100.10.0 255.255.255.0
set gateway 192.168.10.2
set device "root2custA0"
next
end
Finally some traceroute output to show that this all works;
( custA vdom )
( custB vdom )
Vdoms & inter-vdom-links can be fun and challenging. Departmentalizing the fortigate firewall is a feature that can be used for dedication of resources and relinquishing operations and controls to a sub administration.
keep points
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( @ @ )=
o
/ \
This design is beneficial in that you can isolated roles and firewall function but yet have a gatekeeper-firewall pe-se for that department. Each firewall vdom would be Autonomous or
Sovereign. The vdoms can be full or partial meshed. This post will demonstrate a partial meshed.
Sovereign. The vdoms can be full or partial meshed. This post will demonstrate a partial meshed.
1st what is a vdom ?
This feature is a fortinet term for " virtual domain " or simply put; " a firewall Virtualization Technology" . Think of it in the same way of the cisco ASA contexts, or Juniper SRX virtual-routers. We defined a community with a communities of policies, admin, resource-limits and interfaces that are isolated from each others.
1st here's the topology;
Vdom ROOT ( RED ) is our public facing virtual firewall that has access to the internet backbone.
Vdom custA & custB are stacked behind the Root-Vdom and relies on the root-vdom for all internet access. You can look at this as a firewall behind another firewall. In the above drawing, I placed one physical interfaces for the local lan subnets in each customer side vdom.
This concept is used in a lot of hosted of enterprise communities. The number of possible vdoms would be determine by the chassis type and possible the number of physical interfaces you consume for a vdom. We will use both real and virtual interfaces in this example for the 3 vdoms shown.
Root = WAN virtual-link, vlinkcustA2root and vlinkcustB2root,
custA = PORT1 , vlinkcustA2root
custB = PORT2 , vlinkcustB2root
The custA & custB will use these virtual-links as the gateways to internet. These interfaces could have been etherchannels , Wifi-interfaces, or 802.1q tagged subinterfaces. Each vdom custA&B have dhcp-sys-services installed for dynamic allocation.
I like to call this vdom setup a "stacked" approach.
Okay now let's build this out. The setup is quite simple, but the 1st time you stumble into the fortinet vdoms world you might want to build a checklist of things to look at and do B4 you start.
NOTE: the organizing of your design & thoughts, can save a lot of time, create less confusing, and reduce errors/mistakes
So plan ahead for the proposed design.
Okay let put some /30 address on the vlinks that we will use for the 2 customer vdoms ( custA custB )
vlinkcustA2root 192.168.10.0/30 ( .1 + .2 )
vlinkcustB2root 192.168.10.4/30 ( .5 + .6 )
1step assuming your already in vdom cfg mode and have set the firewall up with vdom enabled.
note: All fortigate appliance minus the smaller SOHO have the capability to install upto 10vdoms each. With the bigger chassis you can install vdom license for 10< vdom
config sys global
set vdom-admin enable
end
We 1st build the additional vdoms named ; custA and custB
config vdom
edit custA
next
edit custB
end
2nd step
We define these interfaces port1 and port2 for these vdoms custA and custB respectively
config global
config sys interface
edit interna1
set vdom custA
next
edit internal2
set vdom custB
end
NOTE: You have to have the vdom created before you can place a interface into it.
3rd
Okay now, we will apply our virtual-links cfgs. These are our virtual WAN-uplinks. This is used for inter-vdom traffic ( traffic between vdoms ) and can be looked at as a real interface except it's really virtual. Your clients would not know the difference btw. For all purpose it's a interface. So you can do packet captures, allowaccess, build firewall rules, etc....
Each vlink will have one side addressed in the root-vdom and other side in the customer vdom. The sub numbers will end in a 0 and 1 as shown in the system interfaces. make sure you pay very good attention to the numbers and where you assign them and the address. In this post the Zero ( 0 ) will be in Root and One ( 1) will be in the customer vdom.
( vdom interlink creation )
config system vdom-link
edit "root2custA"
next
edit "root2custB"
next
end
( vdom interlink address config sys interfaces )
edit "root2custA0"
set vdom "root"
set ip 192.168.10.1 255.255.255.252
set allowaccess ping
set type vdom-link
set snmp-index 22
next
edit "root2custA1"
set vdom "custA"
set ip 192.168.10.2 255.255.255.252
set allowaccess ping
set type vdom-link
set snmp-index 25
next
edit "root2custB0"
set vdom "root"
set ip 192.168.10.5 255.255.255.252
set allowaccess ping
set type vdom-link
set snmp-index 27
next
edit "root2custB1"
set vdom "custB"
set ip 192.168.10.6 255.255.255.252
set allowaccess ping
set type vdom-link
set snmp-index 28
next
4th, after you have the vlink installed and configured, we will start the vdom policy configurations. These are simple to configured and you will need policies in ALL vdoms for allowing the traffic flows.
( root firewall address + policies )
config firewall address
edit "custA"
set uuid a435f472-39f9-51e4-3f01-2f63d976cc44
set subnet 10.100.10.0 255.255.255.0
next
edit "custB"
set uuid ad656096-39f9-51e4-0d06-ee9f8c992982
set subnet 10.200.10.0 255.255.255.0
next
end
config firewall policy
edit 0
set srcintf "root2custA0"
set dstintf "virtual-wan-link"
set srcaddr "custA"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set nat enable
next
edit 0
set srcintf "root2custB0"
set dstintf "virtual-wan-link"
set srcaddr "custB"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set nat enable
next
end
( custA firewall address and policies )
config firewall policy
edit 1
set srcintf "internal1"
set dstintf "root2custA1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set comments "custA-outbound"
next
end
( and finally custB )
config firewall policy
edit 1
set srcintf "internal2"
set dstintf "root2custB1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic disable
set comments "custB-outbound"
next
end
NOTE: we are allowing all traffic with no nat enabled, NAt overload will be configured in the root vdom
5th, you need routing for traffic entering and exiting the vdoms and for the root-vdom to route traffic to the local subnets
( custA static route )
config router static
edit 1
set device "root2custA1"
set comment "default custA"
next
end
(custB static route )
config router static
edit 1
set device "root2custB1"
set comment "default custB"
next
end
( root vdom static route to the customer vdom subnets using the inter-vdom-links )
config router static
edit 1002
set dst 10.200.10.0 255.255.255.0
set gateway 192.168.10.6
set device "root2custB0"
next
edit 1001
set dst 10.100.10.0 255.255.255.0
set gateway 192.168.10.2
set device "root2custA0"
next
end
Finally some traceroute output to show that this all works;
( custA vdom )
( custB vdom )
Vdoms & inter-vdom-links can be fun and challenging. Departmentalizing the fortigate firewall is a feature that can be used for dedication of resources and relinquishing operations and controls to a sub administration.
keep points
- be careful of the inter-vdom links numberings
- ensure routing or a routing protocol is used
- firewall for all traffic flows needs to be build across vdoms
- SNAT and DNAT can be complex ( stay focus on what vdom your in )
- look at each vdom as a firewall that unique that happens to sit in the same physical hardware
- leverage 802.1q tagging to avoid port exhausting
- HA clustering and vdom balancing can be a plus for A-P operations
- All interfaces have the ability for ; packet dump, allowaccess, if-index, netflow/sflow,etc......
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( @ @ )=
o
/ \
Thursday, September 11, 2014
Forticlient 5.2.1 536
I'm upgrading all of my mac airbooks to build 536.
( before b351 5.2.0 )
( after )
note: As usual the client warns you when the AV definitions are not updated. So Always update AVDB
more photos of the MACOSX free forticlient
You can learn more by clicking this link http://www.forticlient.com/
( before b351 5.2.0 )
( after )
note: As usual the client warns you when the AV definitions are not updated. So Always update AVDB
more photos of the MACOSX free forticlient
You can learn more by clicking this link http://www.forticlient.com/
Howto find out how many bps a policy is using for a fortigate ( cool-trick from Socpuppets )
In this post we will look a rude, but simple means for counting up how much bandwidth a policy is using.
This uses the simple diag sys session cli command and by capturing the output that we will than pipe into a script. You can set filters based on what you want to sum up or count. You can be get very creative using this approach. Here's an example of our everyday problems.
Question;
How many times have you had a director ask you " how much bandwidth is a person using or how much traffic to/from this host? or we have this new application and how much traffic does it uses? or how much traffic does that SIP call uses ? etc.......... "
And you end up with the deer in the headlights look? and with no response?
Okay here's a means for identifying just how much traffic a policy-id or with other filters applied such as; port,src,dst,etc..... You can get a good base number of overall traffic consumption by applying filters and collecting the data for analysis.
In my case, I'm demonstrating on a FGT3140 and by using firewall policy-id#14 for DNS traffic & host 8.8.8.8 . I would like to get a total sum of how much bandwidth that's being using collectively by that policy-id #14.
1st we will set a session filter with my existing policy-id #14 listed, but let's look at the available filter options that you can act upon.
Now we will use the policy filter and specify the policy-id # and validate the filter was set;
cli
diag sys session filter policy 14
diag sys session filter dst 8.8.8.8
And here's our session filters & with the filters set.
here's the firewall policy-id#14
Now the fun begins, you will need to capture your screen output via the ssh/telnet/console terminal session.
NOTE: On unix I like to use the script cmd before starting my capture and ssh session.
http://unixhelp.ed.ac.uk/CGI/man-cgi?script
Now we execute the cmd with grep to extract the bps line similar to this.
The output of the capture would look something like the following in your capture buffer;
So this captured output can now be acted upon by using a little of unix scripting commands such as; cat/cut/awk . We can take counts & sum up the totals for the lines collected.
e.g
cat <mycollectdata.filename> | grep bps | cut -d "," -f2 | cut -d "=" -f2 | awk '{ sum += $1 } END { print sum }'
So we know the set filter parameters for our system session & policy-id#4 & it has a collected total of 9,034105 mbps of traffic in use. Cool !
By using the appropiāte filters and by being as specific as possible, we can collect data for analysis. I find this a great means for looking at potential abusive users, or to validate and QoS traffic-limiting functions that might be deployed, or determine how much traffic is going to a service, policy, host, protocol, etc..........
Always clear the filters via the following cli cmd before apply new filters and after data collection. Validate that the correct expected filters are applied;
diag sys session filter clear
diag sys session filter
Lastly,
Sometimes we will need to insert a specific policy at the top the list if you wanted to evaluate all traffic for just one particular host. I find this approach is better in a lot of case & I use this approach if not daily at least weekly when doing traffic analysis inspections.
Just add the policy, build your session filter on that policy and then run the command and collect the data. After your satisfied, than remove the policy.
e.g ( let's say you suspect user at 1.1.1.1 is infected with a virus )
config firewall address
edit suspect1
set subnet 1.1.1.1/32
end
config firewall policy
edit 0
set srcintf "port2"
set dstintf "port1"
set srcaddr "suspect1"
set dstaddr "any"
set action accept
set schedule "always"
set service "all"
set comments "checking how much traffic suspect 1 is using by this policy "
next
Than you will move this new policy-id at the top of fwpolicy list, and run your collection as discussed earlier & above.
Just remember that fwpolicies are a top to bottom matched, and then the most specific policy is always used. So if you had policys 1,2,3,4,5,6,7,8,9, from to bottom, the #1 would be looked and matched before going to number 2,3,4 and so on.
So if you wanted to find traffic (ALL ) from suspect1 ( 1.1.1.1 ) you can craft a similar policy and perform your forensic collection. Adjust the services you suspect maybe one protocol or service. And insert it before any broader policy.
remember to remove or disable these temporary policy afterwards
This approach is also great for just determining the top talkers for a particular services or host.
Good luck and I hope you find this approach become beneficial & helpful in your environment.
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( $ $ )=
o
/ \
This uses the simple diag sys session cli command and by capturing the output that we will than pipe into a script. You can set filters based on what you want to sum up or count. You can be get very creative using this approach. Here's an example of our everyday problems.
Question;
How many times have you had a director ask you " how much bandwidth is a person using or how much traffic to/from this host? or we have this new application and how much traffic does it uses? or how much traffic does that SIP call uses ? etc.......... "
And you end up with the deer in the headlights look? and with no response?
Okay here's a means for identifying just how much traffic a policy-id or with other filters applied such as; port,src,dst,etc..... You can get a good base number of overall traffic consumption by applying filters and collecting the data for analysis.
In my case, I'm demonstrating on a FGT3140 and by using firewall policy-id#14 for DNS traffic & host 8.8.8.8 . I would like to get a total sum of how much bandwidth that's being using collectively by that policy-id #14.
1st we will set a session filter with my existing policy-id #14 listed, but let's look at the available filter options that you can act upon.
Now we will use the policy filter and specify the policy-id # and validate the filter was set;
cli
diag sys session filter policy 14
diag sys session filter dst 8.8.8.8
And here's our session filters & with the filters set.
here's the firewall policy-id#14
Now the fun begins, you will need to capture your screen output via the ssh/telnet/console terminal session.
NOTE: On unix I like to use the script cmd before starting my capture and ssh session.
http://unixhelp.ed.ac.uk/CGI/man-cgi?script
Now we execute the cmd with grep to extract the bps line similar to this.
The output of the capture would look something like the following in your capture buffer;
So this captured output can now be acted upon by using a little of unix scripting commands such as; cat/cut/awk . We can take counts & sum up the totals for the lines collected.
e.g
cat <mycollectdata.filename> | grep bps | cut -d "," -f2 | cut -d "=" -f2 | awk '{ sum += $1 } END { print sum }'
So we know the set filter parameters for our system session & policy-id#4 & it has a collected total of 9,034105 mbps of traffic in use. Cool !
By using the appropiāte filters and by being as specific as possible, we can collect data for analysis. I find this a great means for looking at potential abusive users, or to validate and QoS traffic-limiting functions that might be deployed, or determine how much traffic is going to a service, policy, host, protocol, etc..........
Always clear the filters via the following cli cmd before apply new filters and after data collection. Validate that the correct expected filters are applied;
diag sys session filter clear
diag sys session filter
Lastly,
Sometimes we will need to insert a specific policy at the top the list if you wanted to evaluate all traffic for just one particular host. I find this approach is better in a lot of case & I use this approach if not daily at least weekly when doing traffic analysis inspections.
Just add the policy, build your session filter on that policy and then run the command and collect the data. After your satisfied, than remove the policy.
e.g ( let's say you suspect user at 1.1.1.1 is infected with a virus )
config firewall address
edit suspect1
set subnet 1.1.1.1/32
end
config firewall policy
edit 0
set srcintf "port2"
set dstintf "port1"
set srcaddr "suspect1"
set dstaddr "any"
set action accept
set schedule "always"
set service "all"
set comments "checking how much traffic suspect 1 is using by this policy "
next
Than you will move this new policy-id at the top of fwpolicy list, and run your collection as discussed earlier & above.
Just remember that fwpolicies are a top to bottom matched, and then the most specific policy is always used. So if you had policys 1,2,3,4,5,6,7,8,9, from to bottom, the #1 would be looked and matched before going to number 2,3,4 and so on.
So if you wanted to find traffic (ALL ) from suspect1 ( 1.1.1.1 ) you can craft a similar policy and perform your forensic collection. Adjust the services you suspect maybe one protocol or service. And insert it before any broader policy.
remember to remove or disable these temporary policy afterwards
This approach is also great for just determining the top talkers for a particular services or host.
Good luck and I hope you find this approach become beneficial & helpful in your environment.
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( $ $ )=
o
/ \
Wednesday, September 10, 2014
Cisco EVC and tunnel L2 STP packets
I found out some interesting behavior with a ethernet-carrier of ours. They are our VPLS provider and we notice a break in our STP domain between 2 switches that are terminated over each end of the interlink.
Our switches are running RSTP w/ext-sys-id and we specifically set the root-bridge for election. But what we later found out; Per cisco guide lines, tunnel STP does not tunnel the tagged-PVST BPDUs for the 7600s.
http://www.cisco.com/c/en/us/ td/docs/routers/7600/ios/15S/ configuration/guide/7600_15_ 0s_book/l2pt.html
note: So cisco own PVST/RPVST BPDUs are not honored
So if you think about this deeply, cisco own implementation of PVST is " proprietary " and does not fall under the true original IEEE STP scope or definition.
If you think about it more, the non-tagged BPDUs are sent to the STP mac_address ending in "01:80:c2:00:00:00" which is true IEEE 802.1d standards.
But;
Where-as the tagged PVST BPDUs are sent to a mcast mac_address ending in "01:00:0c:cc:cc:cd"
note: A simple packet capture output will demonstrate this behavior as shown for the 2 types
( PVST within a 802.1q tag == vlan-id 903 )
10:07:19.900706 2c:54:2d:c3:11:81 > 01:00:0c:cc:cc:cd, ethertype 802.1Q (0x8100), length 76: vlan 903, p 7, LLC, dsap SNAP (0xaa) Individual, ssap SNAP (0xaa) Command, ctrl 0x03: oui Cisco (0x00000c), pid PVST (0x010b): STP 802.1w, Rapid STP, Flags [Proposal, Learn], bridge-id 6387.1c:e6:c7:52:a6:c0.8201, length 50
message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
root-id 6387.1c:e6:c7:52:a6:c0, root-pathcost 0, port-role Designated
( native vlan == raw no tag true 802.1d )
10:07:21.303624 2c:54:2d:c3:11:81 > 01:80:c2:00:00:00, 802.3, length 60: LLC, dsap STP (0x42) Individual, ssap STP (0x42) Command, ctrl 0x03: STP 802.1w, Rapid STP, Flags [Proposal, Learn], bridge-id 6001.1c:e6:c7:52:a6:c0.8201, length 43
message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
root-id 6001.1c:e6:c7:52:a6:c0, root-pathcost 0, port-role Designated
note: cisco uses these 2 different BPDUs packet-types for comparison & when the native vlan doesn't match, you get that "native vlan mismatch" in your logging
So I found it strange this behavior was strange for a simple EVC configuration & that it would not pass ciscp BPDUs.
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( $ $ )=
o
/ \
Our switches are running RSTP w/ext-sys-id and we specifically set the root-bridge for election. But what we later found out; Per cisco guide lines, tunnel STP does not tunnel the tagged-PVST BPDUs for the 7600s.
http://www.cisco.com/c/en/us/
So if you think about this deeply, cisco own implementation of PVST is " proprietary " and does not fall under the true original IEEE STP scope or definition.
If you think about it more, the non-tagged BPDUs are sent to the STP mac_address ending in "01:80:c2:00:00:00" which is true IEEE 802.1d standards.
But;
Where-as the tagged PVST BPDUs are sent to a mcast mac_address ending in "01:00:0c:cc:cc:cd"
note: A simple packet capture output will demonstrate this behavior as shown for the 2 types
( PVST within a 802.1q tag == vlan-id 903 )
10:07:19.900706 2c:54:2d:c3:11:81 > 01:00:0c:cc:cc:cd, ethertype 802.1Q (0x8100), length 76: vlan 903, p 7, LLC, dsap SNAP (0xaa) Individual, ssap SNAP (0xaa) Command, ctrl 0x03: oui Cisco (0x00000c), pid PVST (0x010b): STP 802.1w, Rapid STP, Flags [Proposal, Learn], bridge-id 6387.1c:e6:c7:52:a6:c0.8201, length 50
message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
root-id 6387.1c:e6:c7:52:a6:c0, root-pathcost 0, port-role Designated
( native vlan == raw no tag true 802.1d )
10:07:21.303624 2c:54:2d:c3:11:81 > 01:80:c2:00:00:00, 802.3, length 60: LLC, dsap STP (0x42) Individual, ssap STP (0x42) Command, ctrl 0x03: STP 802.1w, Rapid STP, Flags [Proposal, Learn], bridge-id 6001.1c:e6:c7:52:a6:c0.8201, length 43
message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
root-id 6001.1c:e6:c7:52:a6:c0, root-pathcost 0, port-role Designated
note: cisco uses these 2 different BPDUs packet-types for comparison & when the native vlan doesn't match, you get that "native vlan mismatch" in your logging
So I found it strange this behavior was strange for a simple EVC configuration & that it would not pass ciscp BPDUs.
The " l2protocol tunnel stp "will tunnel true STP BPDUs and not cisco own " proprietary" types.
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( $ $ )=
o
/ \
Subscribe to:
Posts (Atom)




























