Block Exchange ECP externally
cairnsbryce
Member ✭
in aFleX
I am trying to block Exchange ECP(2013)from external access.
I am having issues with the aFlex rule below:
when HTTP_REQUEST {
if { HTTP::uri] starts_with "/ecp" } {
drop
}
}
In the GUI I get a Warning: aFlex syntax error:line 3;"syntax error in expression"Http::url]starts_with "/ecp" ":variable ref..""
What have done wrong and what would be the right syntax
thanks
Bryce
I am having issues with the aFlex rule below:
when HTTP_REQUEST {
if { HTTP::uri] starts_with "/ecp" } {
drop
}
}
In the GUI I get a Warning: aFlex syntax error:line 3;"syntax error in expression"Http::url]starts_with "/ecp" ":variable ref..""
What have done wrong and what would be the right syntax
thanks
Bryce
Tagged:
0
Comments
amazing what a missed [ will do
when HTTP_REQUEST {
if { [HTTP::uri] starts_with “/ecp” } {
drop
}
}
Thanks,
Gairy
Genard
https://dev-a10wp.pantheonsite.io/aflex-examples/
None of the examples worked, and they all returned that message. I found the shorter link and that one failed also as mentioned above. I though it may be an issue with the parser, so I tried one that was already in our A10, a simple HTTP-to-HTTPS redirect, and that one took. Not sure why these are failing.
Thanks for looking into it.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with “/ecp” } {
drop
}
}
when HTTP_REQUEST {
set URI [HTTP::uri]
if { not [IP::addr [IP::client_addr] equals 192.168.1.0/24] and ($URI starts_with "/ecp")} {
HTTP::redirect "http://example.net/not_authorized.html"
}
}
when HTTP_REQUEST {
set URI [HTTP::uri]
if { not [IP::addr [IP::client_addr] equals 192.168.1.0/24] and ($URI starts_with "/ews")} {
HTTP::redirect "http://example.net/not_authorized.html"
}
}
when HTTP_REQUEST {
set URI [HTTP::uri]
if { not [IP::addr [IP::client_addr] equals 192.168.1.0/24] and ($URI starts_with "/rpc")} {
HTTP::redirect "http://example.net/not_authorized.html"
}
}