https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41310

--- Comment #1 from Saiful Amin <[email protected]> ---
Created attachment 192147
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192147&action=edit
Bug 41310: Add remote_ip (REMOTE_ADDR) to action_logs table to improve security
auditing

This commit adds an ip_address column to the action_logs table and
modifies the logaction function to capture and store the REMOTE_ADDR
from the HTTP request environment. The IP address is properly handled
by Koha's existing RealIP middleware which accounts for proxy servers
and load balancers correctly.

The implementation uses VARCHAR(45) to accommodate both IPv4 and IPv6
addresses, providing permanent audit trail linking actions to specific
IP addresses regardless of session status.

Test Plan:
1. Apply the patch.
2. Run the tests:
   prove t/db_dependent/TestIpLogging.t
   - Verify that all tests pass.
3. Verification:
   - Go to Administration > System preferences > Logs > Logging
   - Enable few preferences, e.g., AuthFailureLog and AuthSuccessLog
   - Login to OPAC with wrong and correct credentials
   - Connect to the Koha database (koha-mysql kohadev) and run this SQL:
     `SELECT * FROM action_logs WHERE ip_address IS NOT NULL;`
     It should show the additional column of `ip_address`.
4. Sign-off

Future improvement should add this IP Address column in the Tools > Log viewer.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to