The sorts of counter-measures you would put in mod_sec are certainly applicable to any application firewall, open source or otherwise. Based on your input, TakeMarket, I'll try to highlight some filters you should consider adding to better protect your Sugar installation.
1) URL encoding validation
Especially applicable for folks with customizations, a filter excluding bad URL requests is a helpful layer to add to your application. Many attacks hinge on the introduction of backspaces, etc in order to find a spot to inject something malicious. Restricting what metacharacters are allowing in a URL to only genuinely used strings can provide a blanket defense against a number of different types of attacks.
mod sec example:
Code:
SecFilterCheckURLEncoding On
SecFilterForceByteRange 0 255
2) SQL injection
Scan the payloads of all POSTs for blatant injection attempts. Prohibiting payloads that contain SELECT, INSERT, or DROP TABLE / DATABASE statements can additionally secure against an unknown threat.
mod sec example:
Code:
SecFilterSelective POST_PAYLOAD ".*select.+from[^<]*"
3) Known offenders
For your particular application firewall solution, find someone who is maintaining a blacklist of known exploited IP addresses. Deploying a good blacklist of zombie machines can go a long way to reducing the amount of bad traffic you receive.
For mod sec users, Got Root (http://www.gotroot.com) actively maintains some of the best lists for web admins.
4) Fully formed requests
Require that every request is fully formed. Since the userbase for a Sugar implementation is always a (relatively) known quantity, take steps to make sure only those types of users can access your Sugar implementation. For most implementations, restricting access by IP is not possible. However, requiring every request to be fully formed (as it would be from any modern browser) can also cut a bulk of the malacious noise down.
Bookmarks