Protect a CodeIgniter 3 admin panel from login attacks
Many Indian businesses still run custom software built on CodeIgniter 3 years ago: a dealer portal, a billing panel, a school ERP. The admin login usually sits at /admin with no lockout. Bots find it and try passwords day and night. The developer who built it may have moved on. This guide is for the developer or IT person now looking after such a system, with practical steps to protect the login without a full rewrite.
Why old admin panels attract attacks
- The login URL is predictable, like /admin or /backend, and scanners find it within days of the site going live.
- There is no lockout, so a script can try thousands of passwords against the admin user without any delay.
- Old accounts of past staff still exist with weak passwords nobody has changed in years.
- Nobody gets alerted, so attacks run for weeks and are discovered only when the server slows down.
Securing the CI3 admin login
- Audit admin users. List every admin account in the database. Disable accounts of people who left. Force a password reset for the rest, with longer passwords. Check password hashing too; very old code may use weak hashing, which your developer should upgrade when users next log in.
- Add a lockout on failed attempts. Add logic that counts failed logins per IP and per username. After a few failures, block further attempts for a while. Make it longer for repeated offenders. In CodeIgniter 3, this can sit in the login controller or a hook. Test that the real admin can still recover by resetting the password.
- Restrict who can reach the panel. If staff log in only from the office or known locations, restrict the admin route to those IPs. If staff work from many places, at least block networks with poor reputation. Fewer people able to reach the login page means fewer attacks reaching your password check.
- Log every login attempt. Store each attempt with time, IP, username and result. This helps you see patterns, prove an attack and spot a successful login from a strange place. Keep the log for a reasonable period and protect it from editing by the admin users themselves.
- Get notified of attacks. Set up alerts for bursts of failures or logins from unusual locations. A message to Telegram or email at the right moment helps someone act. For an old system with no active developer, alerts are often the difference between a small incident and a big one.
How VadiGuard helps
Built-in CodeIgniter 3 module
VadiGuard offers easy module integration for CodeIgniter 3 applications, so you can add protection to an old panel without rewriting it. Its brute-force protection locks out and blocks suspicious login attempts automatically, which covers the missing lockout in many older admin screens.
IP reputation and domain controls
Real-time IP reputation scoring can block harmful IPs and networks before they reach your login code. Domain whitelisting helps allow only authorised domains to use your protected forms. Together they cut the noise hitting an old admin route.
Logs and alerts for a small team
Real-time logs record every attempt with a risk score and reason. Smart alerts notify you on Slack, Telegram, webhook or email when a real attack or a repeat offender is detected. The AI threat summary gives a short daily view in plain language.
An old CodeIgniter panel can be made much safer without a rewrite. Clean up admin users, add lockouts, restrict access, log attempts and turn on alerts. VadiGuard's CI3 module can cover several of these steps. Ask the team for a demo.
Questions people ask
Do we need to upgrade to CodeIgniter 4 first?
Not for this. VadiGuard supports CodeIgniter 3 directly. Upgrading has other benefits, but protecting the login now should not wait for a rewrite.
How long does the integration take?
The basic script tag takes about five minutes. The CodeIgniter 3 module and server-side checks take a little longer, depending on how the login code is written. The team can guide your developer.
Can we still log in if VadiGuard has a problem?
Yes. VadiGuard fails open by design. If its API is unreachable, your login and forms keep working normally, so the admin is never locked out because of the service.
Does it protect other forms in the app?
Yes. Once integrated, the same protection can cover other forms and routes in the application, such as enquiry, registration or password reset pages.