I have a Tomcat 7.0.68 node in Jelastic environment (public IPv4 is enabled). As well this env contains a CentOS VPS node (public IPv4 is enabled as well).
I want to protect both these nodes from brute force attackers, because e.g. Tomcat's log contains a lot of warnings like:
WARNING: An attempt was made to authenticate the locked user "admin1"
For CentOS it can be done with fail2ban (what I did already). But I can not do the same for Tomcat node - jelastic doesn't provide a password for root user and there is no ways to reset/change this password.
Before I configured very secure passwords for Tomcat's users and configured
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
But it protects applications within the Tomcat only.
So my questions are:
- Is it enough to configure LockOutRealm to protect Tomcat from bruteforce?
- Anyway LockOutRealm doesn't protect SSH port. How can I protect SSH on Tomcat's node?
- Does Jelastic provide any anti-bruteforce protection "out of the box"?