25-Aug-2022 17:21
Hello guys.
I'm new to irules, I was looking for some irule that only allows a specific header to access the application, if you don't have this header allowed it will drop this connection attempt. Tried something along those lines, but VS doesn't have persistence.
when HTTP_REQUEST { if { [HTTP::header exists "Header_name"]} { persist uie [HTTP::header "Header_name"] } }
If anyone can help please? Thanks.
26-Aug-2022 06:07
Hi PeteWhite.
Thanks for the help, but this irule will drop the header I want to allow. Instead of drop, it would be allow, I tried to change the drop, but it didn't work.
26-Aug-2022 06:09
Hi Eduardo,
The iRule i added above will drop any HTTP requests which don't have the specified HTTP header. Is that not what you wanted?
26-Aug-2022 06:16
Hello Pete,
Yes that's what I want, I'll do one more test, thanks.
01-Sep-2022 07:35
Hello Pete.
Is it possible to change the Irule to read the value and the header? For example, name = X-Custom-header and value = "ABCDEF123456"
01-Sep-2022 08:04
when HTTP_REQUEST {
if { (! [HTTP::header exists "Header_name"]) || ([HTTP::header value "X-Custom-header" != "ABCDEF123456) } {
drop
}
}