On Tue, 01 Mar 2005 11:08:59 -0800, Google Mike wrote:
> I need to write a PHP page to parse Squid's access.log file so that
> managers here can see where their employees are web browsing. Not a big
> deal except that my manager wants me to prompt people for usernames and
> then behind the scenes it needs to convert the username to IP address
> and grep against the access.log file.
>
> The only way I think that might be possible from a Linux PHP script is
> if somehow I could interrogate the Active Directory to see if it
> recorded the IP address for where that user last logged in. If this was
> not possible from Linux, then perhaps I could write a VB Script to
> interrogate this on Windows and leave the output in a file that Linux
> could pick up and parse.
I find this absurd, but....
You can set up samba to run an arbitrary program on user login. I haven't
done this in about 5 years, but I'm sure it's still there.
Then you can use that program to log the user name, IP, etc. You can even
write a firewall script to block web access unless someone is logged in to
your samba server.
If you have access to your DNS server, and if you use bind, you might have
more luck parsing DNS lookups rather than squid access.log.
Personally, I'd just write something that randomly generates web site
names and IP addresses, and see how long it takes PHB to catch on... I'd
have the resume ready, though, just in case he doesn't see the humor in
it....
--
use munged address above to email me
SpamTrap
(E-Mail Removed)