Forum Discussion
ASM : Allow specific tricky URL
Good morning all ,
Well i have to URL that are driving me crazy and i cannot figure out the best way to allow :
first one :
/email/id_user/user@outlook.com
==> trigger violation of file type
/email/id_user/user2@outlook.edu.us
==> trigger violation of file type
i'm thinking about using regex but i don't know how or where ( with Irules or in "allowed url " )
Second one :
image/avatar/pic01234521.jpg'/
==> trigger illegal metacharac
so how can i allow the ' but only in this path.
I'm looking for the most optimal , secure way to do this work .
And I know this should be simple but I just cant get it working?? Any help will be met with massive amounts respect.
- DaveMu_375542
Nimbostratus
Hi Amine,
If you want to get something like
through;image/avatar/pic01234521.jpg'/
- In "Allowed URLs", you can create one like
image/avatar/*
- Change it from "Explicit" to "Wildcard"
- Click the "Meta Characters" tab that pops up next to "Attack Signatures"
- Then add the
from the list'(0x27)
That will allow any URI starting with
, even if it contains aimage/avatar/
metacharacter.'
- In "Allowed URLs", you can create one like
- DaveMu_375542
Nimbostratus
As to your first question, you could add each of those top level domains to the Allowed File Types. Each violation in the ASM logs should also allow you to learn them individually. If that's impractical for you, you could also write an iRule. It could say something like, IF the URI starts with "/email/id_user/", AND triggers a File Type Violation, it should be UNBLOCKED, but any other violations should remain BLOCKED.
- Amine_373499
Nimbostratus
it's impossible to do it with file type, cauz i ll need to add a lot of extention .ma . fr .com .edu ... a lot .. So i love u're second suggestion ! but can you help more , i've no idea to make it work with Irule !
and also i want to thank you for ur help !
- Amine_373499
Nimbostratus
i wonder if i put this reg as allowed url \/([a-zA-Z0-9_\-.]+)@([a-zA-Z0-9_\-.]+).([a-zA-Z]{2,5})(\/.)?$
should it work ?
- DaveMu_375542
Nimbostratus
You can allow that regular expression in Application Security > Parameters > Parameters List. Create a new Explicit parameter, select "URL" for Parameter Level and enter your path. You can then enable the regular expression in the DataType tab. "enable" the check box and add your expression.
 
Here's a good intro to how iRules works, but I think the following should unblock any request that starts with "/email/id_user/" and also triggers a filetype violation.
 
if { ([HTTP::uri] starts_with "/email/id_user/") and ([ASM::violation names] equals [VIOLATION_OBJ_TYPE]) } { [ASM::unblock] }
I hope this helps!
 
- Amine_373499
Nimbostratus
any further suggestion please ?
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