Flow-based and proxy-based inspection
This lesson is open to everyone. The other lessons open with a package: sign in or sign up, then choose a package.
Key points
- Security profiles are attached to a policy and inspect only the content of traffic that passes an
acceptpolicy: antivirus, web filter, IPS and so on. - Flow-based: packets are inspected as they pass and the file is not fully collected. It is fast and uses few resources. It is the default mode of a new policy.
- Proxy-based: the FortiGate accepts the connection itself, collects the whole object (file, page), inspects it and then forwards it. It is more thorough and offers more features, but takes more memory and time.
- The mode is chosen per policy:
set inspection-mode floworproxy. A profile'sfeature-setmust fit the mode of the policy. - IPS and application control always work the flow way. Some features (for example video filter) require a proxy-based policy.
The policy allows, the profile inspects
The policies so far looked at "who, where, which port". But both a work site and a malicious file can pass through port 443. Security profiles look inside the traffic.
| Profile | What it looks at | Lesson |
|---|---|---|
| SSL/SSH inspection | Opening encrypted traffic | 14 |
| Web filter | The category and address of a site | 15 |
| DNS filter | DNS queries | 16 |
| Application control | Which application it is | 17 |
| Antivirus | Malicious code in files | 18 |
| IPS | Attack signatures | 19 |
| Email filter | Spam | 20 |
| Video filter | Video category and channel | 21 |
A profile is a separate object that is attached to a policy. The same profile can be used in many policies.
FGT-HQ # config firewall policy FGT-HQ (policy) # edit 1 FGT-HQ (1) # set utm-status enable FGT-HQ (1) # set av-profile "default" FGT-HQ (1) # set ssl-ssh-profile "certificate-inspection" FGT-HQ (1) # next FGT-HQ (policy) # end
utm-status enable activates profiles in the policy. In the GUI this is not a separate switch: it turns on by itself when you enable any profile in the Security Profiles section.
Two ways of inspecting
Flow-based. The FortiGate inspects packets as they pass and forwards them at once. It does not collect the whole file, so the delay is small. When a threat is found it cuts the connection: the start of the file has already reached the computer, but since the end has not, the file is unusable.
Proxy-based. The FortiGate stands in the middle as a "proxy": it sets up one connection with the computer and a second one with the server. It first collects the whole file or page, inspects it, and forwards it if it is clean. If there is a threat, nothing goes to the computer and a warning page is shown instead.
| Flow-based | Proxy-based | |
|---|---|---|
| Speed | Faster | Slower |
| Memory | Little | A lot (objects are collected) |
| When a threat is found | The connection is cut | A replacement page is shown |
| Features | Core features | All, plus extras |
| Default | Yes | No |
Choosing the mode
The mode is set separately in every policy:
FGT-HQ # config firewall policy FGT-HQ (policy) # edit 1 FGT-HQ (1) # set inspection-mode proxy FGT-HQ (1) # next FGT-HQ (policy) # end
In the GUI, on the policy page: Inspection Mode: Flow-based / Proxy-based.
Profiles have their own mode too (feature-set). The rule is simple:
- In a flow policy only profiles with
feature-set flowcan be selected. - In a proxy policy both flow and proxy profiles can be selected.
FGT-HQ # config antivirus profile FGT-HQ (profile) # edit "AV-PROXY" FGT-HQ (AV-PROXY) # set feature-set proxy FGT-HQ (AV-PROXY) # next FGT-HQ (profile) # end
If you cannot select a profile in the GUI, this is usually the reason: the policy is in flow mode and the profile is proxy.
Which feature in which mode
| Feature | Flow | Proxy |
|---|---|---|
| IPS, application control | Yes (always the flow way) | Yes (still the flow way) |
| Antivirus | Yes | Yes, plus content disarm (CDR) |
| Web filter | Yes | Yes, with extras (for example time quotas) |
| DNS filter | Yes | Yes |
| Email filter | Basic checks | Full |
| Video filter | Depends on the version | Yes |
| ICAP, WAF | No | Yes |
A practical rule: start with flow. Move to proxy only when you need a feature that flow does not have, and only in that policy.
Version difference: starting with FortiOS 7.4.4, proxy-based features were removed from small models with 2 GB of memory (for example 40F, 60F). If you plan a feature that needs proxy on a small model, read the release notes first.
Large files and ports
Which protocol is inspected on which port is defined by the protocol options profile (config firewall profile-protocol-options). The default profile lists HTTP 80, SMTP 25, FTP 21 and so on.
It also holds the oversize limit: files larger than this pass without inspection (or are blocked, depending on the setting), because a 4 GB file cannot be collected in memory. If antivirus "lets a big file through", this is why.
A short note on NGFW mode
Everything in this lesson refers to the default profile-based mode: profiles are attached to a policy. There is another mode, policy-based, in which the application and the site category are selected directly inside the policy. That mode works only with flow and requires central NAT. In this course we use profile-based mode.
🧪 Hands-on lab · Device: FortiGate-VM
Attaching a profile to a policy and the inspection mode
Policy 1 is ready (LAN → internet). Enable security profiles in it (set utm-status enable) and attach the built-in default antivirus profile and the certificate-inspection SSL profile. Then set the inspection mode of the policy to proxy.
Checked:
- utm-status enable
- av-profile default
- ssl-ssh-profile certificate-inspection
- inspection-mode proxy
Check yourself
5 questions · answers are shown instantly · 3 correct answers complete the lesson
1What happens in flow-based inspection when a threat is found?
2What is the main cost of proxy-based inspection?
3Where is the inspection mode chosen?
4Can you select an antivirus profile with the proxy feature-set in a flow-mode policy?
5Which feature works the flow way even in a proxy policy?
Comments
Sign in to comment.