Identify users accessing or deleting files from server?
Hi,
need to log entries of files deleted and get info such as remote user,remote ip from the same on a lan..
ex:- if someone deletes a file c:/test.txt from my machine i need to know how to get the user and the ip of the machine which deleted the file ...
is this possible?
i hope i am asking this the rt way..
im a delphi developer so would love it if i get a solution in delphi.
have looked at alfa file monitor/dirmon and others available components
dosentget me what i want...
I do know how to audit such using Windows Security Audit and using the Event Viewer.
And... (maybe this will jog some experts memory who knows how to use this), I do know that you might be able to get some information using NetFileGetInfo and/or NetFileEnum.
I did a Google search on "Delphi NetFileGetInfo" and found some code to get connected users to a file, but nothing specific on who deleted a file.
Hope this gets you going. If you want details on setting up your audit policy let me know.
First, what application would you think you need to be aware of? Are people using Explorer to delete these files? FTP? Web Browser? If you have a limited application set you need to be aware of then it may simplify the solution.
There are functions in Windows to get notifications of when a directory is accessed, but I don't know that they tell you who did it just that it happened.
I think, honestly, that you will need to do a file system level hook into windows on the machine you want to monitor. Here is a link to many sources of information on doing Windows File System Drivers.
If you do a file system driver and replace the one window is using currently, but have your drivers calls pass through to the normal OS driver then you can look for things you want to be notified on. Then you define an interface that programs can call to request notifications. This is not a trivial project though.
Firstly, determine if the system event logs contain sufficient information for you:
1. turn on auditing level that includes file Deletion detection
2. set your event log to wrap or make sure you dump/reset the log so that nothing is lost
3. delete files from a remote location
4. examine the logs to see what data is captured
If there is enough information in the event logs, you can monitor these logs in a service or application program. There are also log-aggregating utilities you might consider, although they aren't cheap.
thnx for the answers ..dosent get me what i need :(
i am looking doing a file system level hook into windows on the machine i need to monitor ..
the major problem here ican see is
i need to monitor 4 servers..
2 are windows and the other 2 are linux
i have ppl deleteing stuff from there from allover the lan... need to stop this
I have to agree with aikimark, that is the simple approach. Writing file system level drivers to hook the OS is no small task (especially with two different OSes).
0
pramodpatelAuthor Commented:
Hi aikimark,developmentguru,
I understand .. but im in a 3d environment(Maya with file referencing)
i cannot limit access
i am thinking of the 2 options here..
1:
how abt i write a basic application which checks shell events ..
logs a delete if the files deleted are not on local drives
then get this installed on all machines...
that way i can track deletions on the server .. am i thinking rt here?
2:
also another way to look at this would be to hook a delete .. check what file is abt to be deleted then aloow or deny the delete ... can this be done
Either way it still sounds like a file system level hook. One of the links I gave you also has a set of components that would let you set up a virtual file system based on your own code. This would allow you to have all of the notifications for any files residing in your virtual file system. The virtual file system can appear to be an entire drive but reside in a single file.
file/directory access rights are very granular. You specify what the user CAN do. All other actions are prevented. In this case, you might allow Read, Write, Create rights. The application should function normally. Without deletion rights, the file is protected from any user deletion activities, whether directly or through an application.
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.
One of a set of tools we're offering as a way to say thank you for being a part of the community.
I do know how to audit such using Windows Security Audit and using the Event Viewer.
And... (maybe this will jog some experts memory who knows how to use this), I do know that you might be able to get some information using NetFileGetInfo and/or NetFileEnum.
I did a Google search on "Delphi NetFileGetInfo" and found some code to get connected users to a file, but nothing specific on who deleted a file.
Hope this gets you going. If you want details on setting up your audit policy let me know.
John