Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Wurstsalat
New Contributor III

FortiOS Explicit Proxy rule based on client(!) HTTP header

Hi there,

 

we want to establish Microsoft approach of a "mikro vm" with "application guard" and edge (+chrome+firefox). So in best case we can use one proxy for all use cases, free internet through application guard and restricted internet through default browsing.

Microsoft Edge and Microsoft Defender Application Guard | Microsoft Docs

 

When we enable ApplicationGuardTrafficIdentificationEnabled ( Microsoft Edge Browser Policy Documentation | Microsoft Docs ) the browser in the sandbox sends for his requests an additional http header "X-MS-ApplicationGuard-Initiated". So if i can believe in wireshark, yes this header is send but...it seems not to have any effect on the fortigate

 

We tried the following rule and used as "source"a proxy address (to be honest, we tried several other things but this seems to be the right way...from my understanding)

Wurstsalat_0-1650455389442.png

Just to mention, when we set the host in gui, after we apply, and reopen it, this field is empty again...but when we check in the cli, it is all there.

Wurstsalat_0-1650455789984.png

 

So anyway, we set this as source but the rule seems not to have any effect. Any ideas how we can archive this to be handleb by fortigate?

 

Kind regards

1 Solution
pminarik

"X-MS-ApplicationGuard-Initiated: 1" should be trivial to match:

HTTP host header proxy address objectHTTP host header proxy address object

(replace the Host option with whichever source-IP address object you need).

 

The HTTP/HTTPs part is a good question.
Are these headers supposed to be included in the outer request to the proxy (proxy will always see them), or are they supposed to be included in the inner request? (they would be sent to the real destination server, and DPI would be needed to see them inside encrypted traffic)

Only the first one (outer request to proxy) makes sense to me, but I'm not a MS expert. :)

[ corrections always welcome ]

View solution in original post

12 REPLIES 12
Debbie_FTNT
Staff
Staff

Hey Wurstsalat,

I'm admittedly not very familiar with how FortiGate handles policy matching based on HTTP headers.

However, I came across this somewhat older forum thread: https://community.fortinet.com/t5/Fortinet-Forum/Configuring-HTTP-header-to-allow-quot-youtube-for-e...

-> you might need to enable deep inspection to get FortiGate to see the headers and act on them

-> The GUI issues you mentioned could still be present - I couldn't find that they were ever reported and fixed in our database as of now, but maybe I overlooked something

There's also this:

https://docs.fortinet.com/document/fortigate/6.0.0/handbook/109372/http-headers

But your header doesn't fall into any of the five mentioned, correct?

+++ Divide by Cucumber Error. Please Reinstall Universe and Reboot +++
Wurstsalat

Deep Inspection is active

 

Hm docs.fortinet.com currently down? Cant open any page on this domain...i check it later

 

edit
checked the document, no i dont think our header is mentioned there

Wurstsalat
New Contributor III

anyone else an idea on this?

pminarik

A couple questions:

1, The screenshot shows you configured a match for a header "X-MS-ApplicationGuard-Initiated: X-MS-ApplicationGuard-Initiated". Is the value of the header actually supposed to be equal to the name of the header?

 

2, What did you choose for the "set host ..." setting? This matches on the Host header in the request. (the FQDN of the requested website)

[ corrections always welcome ]
Wurstsalat
New Contributor III

1. From my understanding the header has no value but fortios expects or forces one

 

2. we used here the source addresses, we try to use the host header identification on source, not destination! Still put in the destination adress(es)? Which is basically "any"

pminarik

1, Can you confirm with Wireshark?

 

2, Nevermind, you are actually correct. "HTTP header" is used in source field of policies, so the host matches on the source of the request.

[ corrections always welcome ]
Wurstsalat
New Contributor III

1. only see in http connections the header in the get command:

X-MS-ApplicationGuard-Initiated: 1 \r\n

On https connection, i assume i need to inspect the traffic to see the header so i dont see it...

so for testing i change the header value to 1

 

pminarik

"X-MS-ApplicationGuard-Initiated: 1" should be trivial to match:

HTTP host header proxy address objectHTTP host header proxy address object

(replace the Host option with whichever source-IP address object you need).

 

The HTTP/HTTPs part is a good question.
Are these headers supposed to be included in the outer request to the proxy (proxy will always see them), or are they supposed to be included in the inner request? (they would be sent to the real destination server, and DPI would be needed to see them inside encrypted traffic)

Only the first one (outer request to proxy) makes sense to me, but I'm not a MS expert. :)

[ corrections always welcome ]
Wurstsalat
New Contributor III

tried it this way, seems to work for http and https

 

I have no idea if outer or inner (microsoft doesnt say something about this)...still unable to see the header with wireshark and https connections, anyway works with and without dpi so it must be outer.

Labels
Top Kudoed Authors