I need to log the client IP address (how to configure logging)

31 views
Skip to first unread message

Matthew Wilson

unread,
Oct 7, 2013, 10:55:18 AM10/7/13
to rubycas...@googlegroups.com
Hi --

I just installed rubycas 1.1.1 and I am using passenger.  I want to record the IP address of the client in my rubycas logs.

Is this possible?

How do I do it?

Thanks so much for the help.  RubyCAS is great.

Matt

Robert Mitwicki

unread,
Oct 10, 2013, 4:37:10 AM10/10/13
to rubycas...@googlegroups.com
On Mon, Oct 7, 2013 at 4:55 PM, Matthew Wilson <ma...@tplus1.com> wrote:
Hi --

I just installed rubycas 1.1.1 and I am using passenger.  I want to record the IP address of the client in my rubycas logs.

Is this possible?


Yes it is possible but there is no build in feature right now.

 
How do I do it?


It depends on how you want to store that.
If you want to have that only in logs then the simplest way is just to add in server.rb[1] one line to print out the ip address to log file. In sinatra you can get that by simple using request.ip. So for example the line #464 could look like:

$LOG.debug("Ticket granting cookie '#{tgt.inspect}' granted to #{@username.inspect} from ${request.ip}")

We plan to add much more in rubycas2.0.
If you could describe your use cases (why, what for and how you want to use it) it will be very helpful for us when we will design new functionality.

Thanks a lot
Best regards

Matthew Wilson

unread,
Oct 14, 2013, 11:39:50 AM10/14/13
to rubycas...@googlegroups.com
Thanks so much for the help!  Here's some more explanation on the use cases:

We want to detect brute-force attacks by tracking the velocity of requests from the same client IP address.
Reply all
Reply to author
Forward
0 new messages