473,378 Members | 1,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to audit application actions.

I have a c# 2.0 winform app that runs under a user account with very
limited rights. The application crashes on some actions (the Send Error
to Microsoft screen) with unauthorized exception.

This is despite the fact that I have try catch blocks around pretty much
absolutely everything. I've tried logging to disk, but it seems to
crash on a deeper level.

The app works fine when run under an admin account.
So how can I audit what the application is trying to get access to and
failing to a degree where it can't even log?

Regards
Jan 30 '07 #1
5 4505
On Jan 29, 5:16 pm, Frank Rizzo <n...@none.comwrote:
I have a c# 2.0 winform app that runs under a user account with very
limited rights. The application crashes on some actions (the Send Error
to Microsoft screen) with unauthorized exception.

This is despite the fact that I have try catch blocks around pretty much
absolutely everything. I've tried logging to disk, but it seems to
crash on a deeper level.

The app works fine when run under an admin account.
So how can I audit what the application is trying to get access to and
failing to a degree where it can't even log?

Regards
You need to handle two static, global events that signal uncaught
exceptions. See the following thread:

http://groups.google.com/group/
microsoft.public.dotnet.languages.csharp/browse_frm/thread/
17f2183925c78035/ec669a24ac504841

and here is the MSDN article it referes to:

http://msdn.microsoft.com/msdnmag/is...T/default.aspx

Jan 30 '07 #2
Jeffrey Tan[MSFT] wrote:
Hi Frank,

In .Net Winform, we should use Application.ThreadException event as the
global unhandled exception handler to catch all the exceptions in main GUI
thread. In this global unhandled exception handler,
ThreadExceptionEventArgs.Exception.StackTrace property will reveal the call
stack information of the crash exception. You may save it to the event log
or some other suitable places.
I'll do that. Though i am not sure that it will work, because even
though the app is of type Windows Application, all the processing
happens in Program.cs and then the program exits. There are no actual
GUI involved. So in that respect, it is almost like a Console app. The
only reason it is not a console app is that other apps must be able to
kick it off and the users don't want to see the black box quickly appear
and disappear.
However, .Net Winform has set a default global unhandled exception for
Application.ThreadException, which will pop up an error dialog with all the
error information including the stack trace log. Please see the attached
Default_ThreadException.jpg. So, I am actually surprised to see that your
application will pop up a "Send Error To Microsoft" dialog on crash. Note:
this Application.ThreadException event can only catch the exceptions thrown
in main GUI thread.
Yes, I am surprised as well. Getting the crash with the dialog in your
screenshot would be a welcome change - at least I could see the trace.

Based on the description, it seems that you have used big try...catch
clauses to catch the crash exception, but when you are trying to log it to
the disk file, it failed a second time. Because this problem only occurs
under the limited user account, I suspect the second crash during the
logging should be caused by the security issue. In .Net, there are 2 types
of security: .Net Code Access Security and Windows account security.
No, I don't think it fails on logging because I am logging everything up
to a certain point. Then the logging ceases and the "Send to MS dialog"
pops up. Besides the directory it is logging to is totally open to
everyone (i gave everyone full rights).
First, once your Winform application is launched from the local file
system, the .Net CAS will full trust your application, so the .Net CAS
should not cause any problem in this scenario. Then, the most possible
problem is the Windows security exception. Can you tell me which location
your application is trying to log? I suspect the limited user account may
not have enough write NTFS permission to that location(such as
file/directory). So when you are logging to that file, the Windows NTFS
finds you do not have pemission to write to it, and an security exception
is generated. For example, if the log file or the log directory is created
by an Administrator, then the default NTFS security setting over this
file/directory will not allow the limited user account to write to it.
The directory has full NTFS permissions on it.
If my assumption is correct, the solution is either changing the logging
location to a private folder which the limited account have write
permission or changing the NTFS security setting of the location to give
this limited user account proper write permission.
Jan 30 '07 #3
Hi Frank,

Have you reviewed my last reply to you? Does it make sense to you? If you
need any help or have any concern, please feel free to tell me, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Feb 2 '07 #4
Jeffrey Tan[MSFT] wrote:
Hi Frank,

Have you reviewed my last reply to you? Does it make sense to you? If you
need any help or have any concern, please feel free to tell me, thanks.
Yes, I did, thank you. Meanwhile I found the culprit, one of the files
was losing it's permissions somehow during the installation (will have
to talk to the installation folks). Changing that fixed the issue.

Thanks again.
>
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 2 '07 #5
Hi Frank,

Thanks for your confirm!

If you need further help, please feel free to post, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Feb 4 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Keith | last post by:
Hi I am developing an ASP application which will interact with a SQL database. A requirement of the application is that there is a full audit trail of any modifications to data. I am...
0
by: JohnO | last post by:
Thanks to Serge and MarkB for recent tips and suggestions. Ive rolled together a few stored procedures to assist with creating audit triggers automagically. Hope someone finds this as useful as...
2
by: MUHAMAMD SALIM SHAHZAD | last post by:
dear respected gurus, I would like to share ideas...as i learned from you and wish to tell that i had developed the system where i can audit each and every users and their actions(like...
13
by: Jim M | last post by:
I've been playing with Allen Browne's audit code and found it very useful. I need to track record insertions, deletions, and edits for several tables. I am planning to replace Access with Microsoft...
6
by: Parag | last post by:
Hello, I have been assigned the task to design the audit trail for the ASP.NET web application. I don't know what the best practices for such audit trails are. Our application one dedicated user...
0
by: athos | last post by:
Dear guys, Now we are trying to build an Audit-Log module for our projects. The idea is to 1. develop a module that could be used by different projects to save the log, including account...
0
by: JimLad | last post by:
Hi, I've been tasked with reviewing the Authentication and Auditing of an application and database. ASP/ASP.NET 1.1 app with SQL Server 2000 database. Separate audit trail database on same...
3
by: hary08 | last post by:
im doing a database for Hospital Admission, I have a log in form which prompt user for a password. The source of log in is to look for the values in my Table tblEmployees and match user name and...
5
by: WombatDeath | last post by:
Hi, I want my application to audit any data changes (update, insert, delete) made by the users. Rather than have an audit table mirroring each user table, I'd prefer to have a generic structure...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.