Forum Discussion
Blocking a single IP in ASM - send to the blocking page
I can't for the life of me work out what I would have thought would be a simple thing to do in ASM.
What we would like to do is blacklist a single IP address (or potentially multiple) and send them to the blocking page when they create a violation (or even just block them straight away even if its a good request, if that is easier).
I am aware I could write an irule to drop the request or send back a specific response, but we'd like to send them to the configured blocking page we have already made (along with a support ID being shown if they generate a violation). Is this possible? I can find places to whitelist IPs, but nowhere to blacklist them!
Thanks in advance
James
- JamesS_40157
Nimbostratus
Would something like this work in the meantime? I realise it will basically allow anything through that isn't in the block list:ASM::disable
}
- JamesS_40157
Nimbostratus
A slightly revised version, would this be ok? (more specific to webscraping now)when ASM_REQUEST_VIOLATION {
set x [ASM::violation_data]if {([lindex $x 0] contains "VIOLATION_WEB_SCRAPING_DETECTED")} {if { ! [matchclass [IP::remote_addr] equals /Common/asmblockips] } {ASM::disable}}}
However i have just read the asm::enable and asm::disable functions only work within HTTP_CLASS_SELECTED, if this is the case, i guess i cant be specific down to the attack type?
- nitass
Employee
just curious why you need support id while blocking them right away. - JamesS_40157
Nimbostratus
Hi Nitass, good point regarding the support ID. We just want to display the same blocking page, which includes the <%TS.request.ID()%> code. If this particular IP wants to appeal against the block then it would look a bit strange to them if they dont have the support ID listed. - nitass
Employee
The whitelist is indeed where you say it is, but there is also an "ignored IP addresses" section which i would assume just disables ASM for that particular IP.i never tested it but thinking it is for learning suggestion only. - JamesS_40157
Nimbostratus
Ah i see, that makes sense. Well, im only concerned with web scraping at the moment so thats OK as far as a whitelist goes. - reseob_90588
Nimbostratus
Is there any update on this? The initial iRule solution wasn't really a functional solution for us as it simply disables ASM for IP's that aren't in the list.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com